General discussion

  • Creator
  • #2075153

    Excel97 Application.Dialogs & strings


    by web maxtor ·

    Using Excel97, I want to use Application.Dialogs(xlDialogSaveAs).Show plus the first document_text arguement to allow a user to decide what path a file should be saved to, while suggesting a file name. The file name is a string including some text,the date, another app’s user name, etc.

    sTodaysDate = date formatted as MMDDYY earlier
    sUserName = a user name I got earlier
    sSaveFile = “PHO.QTE.” & sTodaysDate & “.” & sUserName
    Application.Dialogs(xlDialogSaveAs).Show sSaveFile

    The dialog box displays the sSaveFile string correctly in the file name box, but surrounds it with quotation marks. If I replace sSaveFile with some text, the quotes go away. How do I build the filename, and fill in the file name box, without quotation marks?

    Thank you,


All Comments

  • Author
    • #3788516

      Excel97 Application.Dialogs & strings

      by tclere ·

      In reply to Excel97 Application.Dialogs & strings

      Add the .xls extension to sSaveFile otherwise Excel thinks that you want to save the file with a .sUserName extension.

      sFile = “PHO.QTE.” & sDate & “.” & sUser & “.xls”

      You could also replace the .’s with some other character to avoid this problem.

Viewing 0 reply threads