Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default question about creating a message box

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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default question about creating a message box

Hi
try something like the following:

path_name = inputbox("Enter your path","Path-Entry","C:\")
where "C:\" is the default value

--
Regards
Frank Kabel
Frankfurt, Germany

slim wrote:
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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default question about creating a message box

Thanks Frank. That did it!

"Frank Kabel" wrote in message
...
Hi
try something like the following:

path_name = inputbox("Enter your path","Path-Entry","C:\")
where "C:\" is the default value

--
Regards
Frank Kabel
Frankfurt, Germany

slim wrote:
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.




  #4   Report Post  
Posted to microsoft.public.excel.programming
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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a message to find my posts - again! imacken Excel Discussion (Misc queries) 5 December 15th 09 09:53 PM
Fonts warning message when creating charts Tom-S Excel Discussion (Misc queries) 5 December 23rd 08 12:50 PM
Error message when creating PivotTable Alexandre Excel Discussion (Misc queries) 1 November 27th 06 10:06 AM
Creating mail message with a button click Ray Proudfoot Excel Programming 8 October 2nd 03 08:36 PM
Creating a Sendmail message Paul Excel Programming 1 September 10th 03 06:35 PM


All times are GMT +1. The time now is 06:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"