I am using the GetSaveAsFileName method in Excel 2007 VBA to allow the user to navigate to and specify a folder & file that will be used later in the program for output of text data. Following is my code:
VBA invariably returns "Error 2015" as my FileName, which is dimmed as Variant. Filter and Title are dimmed as String, and FilterIndex as Integer. I need to allow the user to specify an existing file OR specify a brand new file for output. Are there specific items that need to be active in my Reference list? I see lots of stuff on the net about this issue, but no solutions. Thanks for any help.
Code:
With Application
FileName = .GetSaveAsFilename(Filter, FilterIndex, Title)
ChDrive (Left(.DefaultFilePath, 1))
ChDir (.DefaultFilePath)
End With
VBA invariably returns "Error 2015" as my FileName, which is dimmed as Variant. Filter and Title are dimmed as String, and FilterIndex as Integer. I need to allow the user to specify an existing file OR specify a brand new file for output. Are there specific items that need to be active in my Reference list? I see lots of stuff on the net about this issue, but no solutions. Thanks for any help.