View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charles Chickering Charles Chickering is offline
external usenet poster
 
Posts: 272
Default Probably a stupid question. Get workbook name.

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
--
Charles Chickering

"A good example is twice the value of good advice."


"Rominall" wrote:

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.