MACRO Saveas Keeping Current file open ?

antfield

New Member
Joined
Mar 28, 2006
Messages
33
I have the following Macro that I run assigned to a Button.

Sub AskAndDo()
If MsgBox("Have you Finished collecting data ?", vbYesNo + vbQuestion) = vbNo Then
Exit Sub
Else
If MsgBox("Have you Printed the Reports ?", vbYesNo + vbQuestion) = vbNo Then
Exit Sub
Else
ActiveWorkbook.SaveAs Filename:="\\gamingnt\company\FLOAT MASTER\Float_Sheet_" & Format(Date, "_YY_MM_DD")
End If
End If
Application.Quit
End Sub


What I need is to save as the file that this statement creates
{ActiveWorkbook.SaveAs Filename:="ActiveWorkbook.SaveAs Filename:="\\gamingnt\company\FLOAT MASTER\Float_Sheet_" & Format(Date, "_YY_MM_DD" }
BUT keep the current file open.
ie. I open file called Master_Float.xls
I click the Macro saving as Float_Sheet_yy_dd_mm, but I simply wish to just save it, but keep Master_Float.xls open ?

Any Idea's ?
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi,

When you use save as and save a file withanother name, then the original file always disappears, does it not? Maybe before doing the SaveAs you could just save master_Float, then the Save as will remove it, then re-open Master Float and then close the Saved file.

Does that make sense?
 
Upvote 0
I've got it in my head that there's a SaveCopyAs function or something similar, but can't seem to recall how/where to use it.

Will have a look around.

I may be dreaming it.
 
Upvote 0
MACRO SaveCopyas

I am having an issue using the SavecopyAs command, when saved it does not have a file extention, like .xls.

I would like it to be saved as default .xls,
I would also like it so save with Read only attributes.

Example of current code...

ActiveWorkbook.SaveCopyAs Filename:="\\gamingnt\company\FLOAT MASTER\Float_Sheet_" & Format(Date, "_YY_MM_DD")

Can you also have the file when saved, if the desination file exists, add a number after the original file name, so it might look like Float_Sheet_08_11_14-1-

Thanks
 
Upvote 0
Hi,

Then try;

Code:
ActiveWorkbook.SaveCopyAs Filename:="\\gamingnt\company\FLOAT MASTER\Float_Sheet_" & Format(Date, "_YY_MM_DD")[COLOR="Red"][B] & ".xls"[/B][/COLOR]
 
Upvote 0

Forum statistics

Threads
1,215,061
Messages
6,122,922
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top