how to pause a 'save-as' and continue after input

M

Mikeeusa

I have a Master workbook that needs to be renamed before use so that the
master remains blank of data and ready for the next event. I need a way to
pause the macro and let the user enter a new name, hit save and the macro
continue. Currently when I try to record, I hit file/save-as and the save
window opens, awaiting input, I then cannot pause or stop recording as it
blips me as there is no input. I don't want to have the new name inserted as
it will change every 6 months.
I would be satisfied with the macro stopping after the save-as window is
opened so the user could input a new name and manually save it.
Please be specific on where to place the code as I am an intermediate on
macro's and worse on VBA. I do know how to step into it, but very
unknowledgeable on editing the code.
thanks
 
J

JW

Have a look at Application.GetSaveAsFilename. You can capture the
value entered by the user and pass it to your SaveAs code. Kinda hard
to help without seeing your current code.
 
M

Mikeeusa

OK, I looked at a bunch of messages and put a few together and tore some
apart and came up with the simple following code:

Sub saveas()
'
' saveas Macro
' Macro recorded 8/21/2007 by Michael F. O'Brien
'
' Keyboard Shortcut: Ctrl+u
'
Application.DisplayAlerts = False
ActiveWorkbook.saveas Filename:=Range("I3").Value
Application.DisplayAlerts = True
End Sub

The value in I3 is input by the user prior to clicking the corresponding
button to run the macro.

It seems to work! I did notice that in 1 of the threads the user reported
that his file extension of .xls had changed to 'file'. That didn't happen to
me, but might it happen? Like I said, this seems to work, am I missing a
problem or should this be the fix I need?
 

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