Probably a stupid question. Get workbook name.

G

Guest

I have a workbook opens and closes other workbooks so I need to reference the
'master' workbook. However, there are points during code run that the user
can save the file as a different name and I don't want to keep them from
doing that. Problem, they can also change the other workbook names too. For
the other workbooks I don't care if they can or can't change the file name.

Question: What is the easiest way to capture when a user does a save as?
And is there a way to have a msgbox/error box pop up so they know exactly
which workbook they are saving?

I have no control over naming conventions and I have been hit with very
similiar file names which has confused the users.

Problem: I use screenupdating off, so there are a few spots where it looks
like one of the other workbooks is open when it's really the master workbook.
 
G

Guest

You could create a variable then do the save as on that:
Dim wb As Workbook
Dim SvNm As String
Set wb = Worbooks.Open("C:\Book1.xls")
SvNm = Application.GetSaveAsFilename("C:\","Excel Files, _
*.xls",0,"Select File Name","Save")
wb.SaveAs Filename:=SvName
 

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