Create exe to save text fields to a csv file RRS feed

  • Question

  • Hi, we are a medical clinic and would like to have patients complete some registration information on a tablet or kiosk in the lobby. Our health records system allows us to upload a .csv file to start the registration process. I created a userform in Excel which has the fields we need and a macro which saves it to a network drive. There would need to be the ability to set the file save to path since it may vary by location. 

    What is the best way to have this functionality put into a standalone executable which could run on our Windows tablet? 

    "Private Sub cmdSend_Click()
    Range("A2").Value = txtFirstName.Text
    Range("C2").Value = txtLastName.Text
    Range("D2").Value = txtDOB.Value
    If OptionButton1.Value Then
        Range("E2").Value = "F"
    ElseIf OptionButton2.Value Then
    Range("E2").Value = "M"
    ElseIf OptionButton3.Value Then
    Range("E2").Value = "U"
    End If

    Range("G2").Value = txtAddress.Text
    Range("I2").Value = txtCity.Text
    Range("J2").Value = txtState.Text
    Range("K2").Value = txtZip.Text
    Range("P2").Value = txtHomePhone.Text
    Range("R2").Value = txtCellPhone.Text
    Range("S2").Value = txtEmail.Text
    End Sub

    Private Sub CommandButton1_Click()
    Dim fname As String
    Dim path As String

    fname = txtLastName.Text & ".csv"
    path = "Z:\PatientFilesToUpload\"

        Application.ActiveWorkbook.SaveAs Filename:=path & fname, FileFormat:=xlCSV, CreateBackup:=False

    Dim ctl As Control

    For Each ctl In frmPatientData.Controls
        If TypeName(ctl) = "TextBox" Then ctl.Value = ""

    End Sub

    Private Sub txtDOB_Change()

    End Sub

    Private Sub UserForm_Click()

    End Sub"
    • Moved by 宝宝徐 Tuesday, August 8, 2017 5:57 AM
    Monday, August 7, 2017 4:22 PM

All replies

  • Hi,

    Welcome to MSDN forum.

    This forum is discussing Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor. I will move your thread to Microsoft Office for Developers >Excel for Developers  for professional support.

    Best regards,


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Tuesday, August 8, 2017 5:51 AM
  • Hi RickL912,

    As far as I know, it is impossible to run macro on Excel for Window tablet. So I would suggest you develop an Office Add-ins to do this job.

    Here is the introduction of Office Add-ins.

    Best Regards,


    Wednesday, August 9, 2017 10:12 AM