Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to use a msgbox and ask a user to input a filename then,
when they hit ok, save the file as "C:\Folder1\Folder2\TheirInput.xls" I would also like to test for no entry and alert then require entry again if they don't put information in there. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can't do that with a Msgbox; you need an Inputbox.
Retry: Filename = Inputbox("Please enter the file name here") if Filename<"" and Filename<"False" then Activeworkbook.saveas "C:]FOlder1\Folder2\" & Filename & ".xls" Else goto Retry Endif "Bill Burlison" wrote in message ... I would like to use a msgbox and ask a user to input a filename then, when they hit ok, save the file as "C:\Folder1\Folder2\TheirInput.xls" I would also like to test for no entry and alert then require entry again if they don't put information in there. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This snippet will ask the user to provide a file name, check if for validity
as a string, prevent them from entering a blank space and shut down the procedure if they choose to cancel the process. You can work with it to suit your purposes. Do fileName = Application.InputBox("ENTER A BRIEF TITLE FOR THE NEW FILE." & Chr(10) & Chr(10) & "PLEASE RESTRICT TO NO MORE THAN TWO WORDS.", "NEW FILE NAME", Type:=2) fileName = StrConv(fileName, vbProperCase) newFile = YourPath & fileName & ".xls" If fileName = False Or fileName = "" Or fileName = " " Then Response = MsgBox("YOU MUST ENTER A FILE NAME FOR THE OR CLICK CANCEL TO EXIT THE PROGRAM.", vbRetryCancel, "INVALID ENTRY") End If If Response = 2 Then TitleScrn Exit Sub End If Loop While Response = 4 "Bill Burlison" wrote: I would like to use a msgbox and ask a user to input a filename then, when they hit ok, save the file as "C:\Folder1\Folder2\TheirInput.xls" I would also like to test for no entry and alert then require entry again if they don't put information in there. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use this one. The other one had a reference to a procedure that you don't
need and would probably cause a runtime error. Do fileName = Application.InputBox("ENTER_ A BRIEF TITLE FOR THE_ NEW FILE." & Chr(10) & Chr(10) & "PLEASE_ RESTRICT TO NO MORE THAN TWO_ WORDS.", "NEW FILE NAME", Type:=2) fileName = StrConv(fileName,_ vbProperCase) newFile = YourPath & fileName & ".xls" If fileName = False Or fileName = "" Or fileName = " "_ Then Response = MsgBox("YOU MUST_ ENTER A FILE NAME OR CLICK_ CANCEL TO EXIT THE PROGRAM.", vbRetryCancel,_ "INVALID ENTRY") End If If Response = 2 Then Exit Sub End If Loop While Response = 4 "JLGWhiz" wrote: This snippet will ask the user to provide a file name, check if for validity as a string, prevent them from entering a blank space and shut down the procedure if they choose to cancel the process. You can work with it to suit your purposes. Do fileName = Application.InputBox("ENTER A BRIEF TITLE FOR THE NEW FILE." & Chr(10) & Chr(10) & "PLEASE RESTRICT TO NO MORE THAN TWO WORDS.", "NEW FILE NAME", Type:=2) fileName = StrConv(fileName, vbProperCase) newFile = YourPath & fileName & ".xls" If fileName = False Or fileName = "" Or fileName = " " Then Response = MsgBox("YOU MUST ENTER A FILE NAME FOR THE OR CLICK CANCEL TO EXIT THE PROGRAM.", vbRetryCancel, "INVALID ENTRY") End If If Response = 2 Then TitleScrn Exit Sub End If Loop While Response = 4 "Bill Burlison" wrote: I would like to use a msgbox and ask a user to input a filename then, when they hit ok, save the file as "C:\Folder1\Folder2\TheirInput.xls" I would also like to test for no entry and alert then require entry again if they don't put information in there. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks you two. I have learned a bunch about msgbox in trying to do
this. Guess I can start on input boxes now. Your help will make the start easier! Much asppreciated. On Wed, 08 Nov 2006 11:58:05 -0800, Bill Burlison wrote: I would like to use a msgbox and ask a user to input a filename then, when they hit ok, save the file as "C:\Folder1\Folder2\TheirInput.xls" I would also like to test for no entry and alert then require entry again if they don't put information in there. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
http://CannotDeleteFile.net - Cannot Delete File? Try Long Path ToolFilename is too long? Computer Complaining Your Filename Is Too Long? TheLong Path Tool Can Help While most people can go about their businessblissfully unaware of the Windo | Excel Discussion (Misc queries) | |||
Macro to save file as different filename | Excel Worksheet Functions | |||
MsgBox for filename and static path | Excel Programming | |||
Save file as filename plus fieldname | Excel Programming | |||
Save filename as new file name | Excel Programming |