Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
cbm cbm is offline
external usenet poster
 
Posts: 13
Default SAVE AS... WITHOUT COPYING THISWORKBOOK MACRO´S

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default SAVE AS... WITHOUT COPYING THISWORKBOOK MACRO´S

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
"cbm" wrote in message
ups.com...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
cbm cbm is offline
external usenet poster
 
Posts: 13
Default SAVE AS... WITHOUT COPYING THISWORKBOOK MACRO´S

Good idea!!!
Thanks a lot, Otto

Otto Moehrbach ha escrito:

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
"cbm" wrote in message
ups.com...
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Module1 vs Thisworkbook for Macro Craigm[_16_] Excel Programming 4 June 28th 05 01:17 PM
Copying ThisWorkBook Events mark_1969 Excel Programming 3 December 10th 04 04:04 AM
Copying "ThisWorkbook" objects rpgun[_4_] Excel Programming 0 October 26th 04 12:35 PM
ThisWorkbook.Save not working under Workbook_BeforeSave, Help! Michel[_3_] Excel Programming 4 May 30th 04 06:49 PM


All times are GMT +1. The time now is 02:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"