SAVE AS... WITHOUT COPYING THISWORKBOOK MACRO´S

C

cbm

Hi,

I´ve got this macro in a workbook (inside Thisworkbook), and i need it
not to get copied when i save as... ; so original won´t change.


Private Sub Workbook_Activate()
Application.DisplayFullScreen = True
Application.CommandBars("Full Screen").Visible = False
Application.CommandBars("Worksheet Menu Bar").Enabled = False
ActiveWindow.DisplayWorkbookTabs = False
Application.CommandBars("Web").Visible = False
end sub


Any idea??? I´ve already tried this inside the command button from
which i save as :



Application.DisplayFullScreen = True
Application.CommandBars("Full Screen").Visible = True
Application.CommandBars("Worksheet Menu Bar").Enabled = True
ActiveWindow.DisplayWorkbookTabs = True
Application.CommandBars("Web").Visible = True
ThisWorkbook.SaveCopyAs "C:...\..."
Application.DisplayFullScreen = True
Application.CommandBars("Full Screen").Visible = False
Application.CommandBars("Worksheet Menu Bar").Enabled = False
ActiveWindow.DisplayWorkbookTabs = False
Application.CommandBars("Web").Visible = False


But first try it kept the copy with false options and original changed,
and second try gave an error


THANKS A LOT AND MERRY CHRISTMAS
 
O

Otto Moehrbach

If the reason you don't want that macro copied with the file is that you
don't want the macro to run in the new file, then simply add code to the
beginning of the macro to check the name of the file. If the name is NOT
that of the original file, then exit the sub. HTH Otto
Hi,

I´ve got this macro in a workbook (inside Thisworkbook), and i need it
not to get copied when i save as... ; so original won´t change.


Private Sub Workbook_Activate()
Application.DisplayFullScreen = True
Application.CommandBars("Full Screen").Visible = False
Application.CommandBars("Worksheet Menu Bar").Enabled = False
ActiveWindow.DisplayWorkbookTabs = False
Application.CommandBars("Web").Visible = False
end sub


Any idea??? I´ve already tried this inside the command button from
which i save as :



Application.DisplayFullScreen = True
Application.CommandBars("Full Screen").Visible = True
Application.CommandBars("Worksheet Menu Bar").Enabled = True
ActiveWindow.DisplayWorkbookTabs = True
Application.CommandBars("Web").Visible = True
ThisWorkbook.SaveCopyAs "C:...\..."
Application.DisplayFullScreen = True
Application.CommandBars("Full Screen").Visible = False
Application.CommandBars("Worksheet Menu Bar").Enabled = False
ActiveWindow.DisplayWorkbookTabs = False
Application.CommandBars("Web").Visible = False


But first try it kept the copy with false options and original changed,
and second try gave an error


THANKS A LOT AND MERRY CHRISTMAS
 

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