LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Making Workbook_Open macro conditional

I have a file with a Workbook_Open macro (see below) but there is another
macro which enables the user to save the most worksheets in the file with a
new name. The new file retains the Workbook_Open macro which I don't want
not least because the Worksheet "Menu" referred to has been deleted so keps
coming up with an error.

I've tried including code to remove the Workbook_Open macro before saving as
a new file without success but thought this may be an easier way.

Is it possible to make the Workbook_Open macro conditional by adding code
like

If this file is called myfilename.xls
Then
(add Workbook_Open macro code here)

Else
End Sub

If so, what is the correct syntax

Thanks in anticipation

Keith

-----------
Private Sub Workbook_Open()
ThisWorkbook.Activate
Application.Calculation = xlCalculationManual
Sheets("Menu").Select
End Sub
 
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
workbook_open() does not execute if there are conditional formats pnocero Excel Worksheet Functions 1 May 9th 09 02:25 PM
Workbook_Open macro not running mrice Excel Discussion (Misc queries) 2 April 26th 06 06:45 PM
Help with Workbook_Open macro please Geoff C Excel Programming 7 January 13th 05 10:19 AM
Prevent Workbook_Open macro big t Excel Programming 2 August 20th 04 12:01 PM
Workbook_Open & Macro James Cox[_2_] Excel Programming 0 July 2nd 04 03:44 PM


All times are GMT +1. The time now is 10:05 PM.

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"