Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yeah the Option Explicit got me. Need to Dim the fName variable.
Dim fName As String Put that after the sub title line. "Christine" wrote: Hi JLG, I tried the code you gave me, but it doesn't work. I get "Compile error: Expected Function or variable" and it highlights the "fName =" part. Have I done something wrong? Best, Christine "JLGWhiz" wrote: Option Explicit Sub SaveAsText() ' ' SaveAsText Macro Dim FileName As String FileName = "YourFileName" fName = Application.Dialogs(xlDialogSaveAs).Show (FileName) ActiveWorkbook.SaveAs Filename:=fName End Sub "Christine" wrote: Hi group, I feel that I am close to figuring this out, but am missing the last piece of the puzzle. I have created a macro that when run, prompts the user to save the file. The missing pieces are 1) I want the file to be saved in tab delimited format. 2) I want the file to be saved in the same place as the original file. This is what I have so far: Option Explicit Sub SaveAsText() ' ' SaveAsText Macro Dim FileName As String FileName = "YourFileName" Application.Dialogs(xlDialogSaveAs).Show (FileName) End Sub Thanks, Christine |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Prompt for Save As Window through macro | Excel Programming | |||
Need simple prompt to save at end of macro | Excel Programming | |||
save prompt for user exit, but no save prompt for batch import? | Excel Discussion (Misc queries) | |||
How to CANCEL file SAVE PROMPT when MACRO is running? | Excel Discussion (Misc queries) | |||
Can a MACRO prompt for the filename to open and/or save? | Excel Programming |