VB File Save

J

John A

I have an Excel 97 workbook that produces a sheet of cheque-print
data. I have a VB macro that reads data from a text file from another
application into the workbook, and another VB Macro that saves data on
this sheet to a comma-delimited text file (for input to Word for
cheque printing).

I currently have the file paths for the text files hard-coded into the
VB macro.

I would like to be able to select the paths from a standard Windows
File Open and File Save box, but the only option I can find is to
enter the path in an InputBox, which is not very good.

Can this be done?

Thanks

John Allen
 
I

IC

This copied directly from Excel help (GetSaveAsFilename Method)

fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="Text Files (*.txt), *.txt")
If fileSaveName <> False Then
MsgBox "Save as " & fileSaveName
End If

Ian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top