View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jean-Yves[_2_] Jean-Yves[_2_] is offline
external usenet poster
 
Posts: 253
Default question about creating a message box

Hi,

Small correction :I think you have an "InputBox", not a "messagebox"
In order to have a correct path, I sugest you would use the XL dialogue
Dim strNameToSaveAs As String
ChDrive ("C:\")
ChDir ("C:\YourProject\")
'here you show the dialog
strNameToSaveAs =
Application.GetSaveAsFilename(InitialFilename:="Yo urProposalName",
FileFilter:="Microsoft Excel File (*.xls),*.xls")
'it return -but does nothing yet - the file name tho saveas
If strNameToSaveAs = "False" Then
Exit Sub
Else
ActiveWorkbook.SaveAs FileName:=strNameToSaveAs, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End If
HTH

Regards,
JY


"slim" wrote in message
...
I have a macro that I created (thanks to the help of this board), and in

the
macro, I've created a message box in which it prompts you to enter the
directory path of where you want to save the files. The box works
correctly.

Is there someway that I have default writing in the message box where you
enter the data? I would like a default path to come up, but if the user
wants to change the path, they should be able to overwrite the path,

simply
by highlighting the default path and typing over it.

Thanks for everyone's help.