Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default error in code when placed in workbook_open

Sub Workbook_Open()
Worksheets("Sheet2").Select
Call Macro1
End Sub

I am getting an error of:

'Compile error:

Sub or Function not defined'




Yet if i manually run the macro it works fine??


Corey....
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default error in code when placed in workbook_open

Corey,
Where is "macro1" ? Public in a normal module ?

NickHK


"Corey" wrote in message
...
Sub Workbook_Open()
Worksheets("Sheet2").Select
Call Macro1
End Sub

I am getting an error of:

'Compile error:

Sub or Function not defined'




Yet if i manually run the macro it works fine??


Corey....


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default error in code when placed in workbook_open

Macro1 is in the code for the Thisworkbook

Is'nt that were anything to run when opening is to be placed?

ctm

"NickHK" wrote in message
...
Corey,
Where is "macro1" ? Public in a normal module ?

NickHK


"Corey" wrote in message
...
Sub Workbook_Open()
Worksheets("Sheet2").Select
Call Macro1
End Sub

I am getting an error of:

'Compile error:

Sub or Function not defined'




Yet if i manually run the macro it works fine??


Corey....




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default error in code when placed in workbook_open

Sorry i made a mistake.
Macro1 is in the code for Sheet2.

AHHH

Thanks for the pointer.
I moved it to a Module and it now is fine.

Thanks
Corey....



....
"NickHK" wrote in message
...
Corey,
Where is "macro1" ? Public in a normal module ?

NickHK


"Corey" wrote in message
...
Sub Workbook_Open()
Worksheets("Sheet2").Select
Call Macro1
End Sub

I am getting an error of:

'Compile error:

Sub or Function not defined'




Yet if i manually run the macro it works fine??


Corey....




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default error in code when placed in workbook_open

Hi Corey,

Where is Macro1 housed?


---
Regards,
Norman


"Corey" wrote in message
...
Sub Workbook_Open()
Worksheets("Sheet2").Select
Call Macro1
End Sub

I am getting an error of:

'Compile error:

Sub or Function not defined'




Yet if i manually run the macro it works fine??


Corey....




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
Workbook_Open code help Colin Hayes Excel Discussion (Misc queries) 1 April 5th 10 02:13 AM
Range.Select error and screen maximizing error in Workbook_Open() Punsterr Excel Programming 3 May 10th 06 10:16 PM
Range.Select error and screen maximizing error in Workbook_Open() Punsterr Excel Programming 0 May 10th 06 07:56 PM
Deleting Workbook_Open code Paige Excel Discussion (Misc queries) 3 January 31st 06 07:39 PM
Removing Workbook_Open code Tom Ogilvy Excel Programming 0 September 1st 04 09:04 PM


All times are GMT +1. The time now is 12:31 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"