PDA

View Full Version : Excel97 VBA Windows API Call - File Save



parry
14-08-2002, 04:06 PM
Hi, I have an Excel spreadsheet that exports data to a text file. I have everything working OK for creating the file but would now like the ability for the user to select their own destinaion folder and filename.

The Windows Common Dialog Box is not available in Excel (only VB) so I need to do an API call for the File-Save dialog box with VBA code. Anybody know a site where I can get this code?

cheers
Parry

Russell D
14-08-2002, 05:56 PM
Look in Excel VBA Help using "GetSaveAsFilename"

parry
14-08-2002, 08:14 PM
Superb thanks Russell! I was thinking it was going to be one of those references to hex codes that I've seen in other peoples code <shudder>. Looks simple enough so I presume I just assign a variable to that statement then include the variable in my Open for Output line? You beauty.

cheers
Parry