View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Saving a workbook step in a Macro

Are you saving the workbook with the code?
Do you want to overwrite the existing workbook?

If yes to both, you can use:
thisworkbook.save

If you want to save a different workbook with the same name as the workbook
that's running the code, then nope--you can't use Save|As.

You can only have one file open with any particular name.

There may be other work arounds.

You could save the file with a temporary name. Close that file. And then use
the Name statement to rename it to what you want.

There are other things to consider, too.

Is the workbook opened readonly?

Are you trying to use the same drive/path/filename or what????

Mark wrote:

I created a simple formatting macro and included the "save As" in the macro,
of course it wants to save the workbook as the name indicated in the macro.
Can I have the macro save the workbook as the current workbook name?


--

Dave Peterson