Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Auto_open not executing

I have created an Auto_Open sub which does properly execute if the workbook
is opened via Windows. But if the same workbook is opened via a VBA
statement from within another workbook, the Auto_Open does not execute even
though the workbook in fact is opened.

Any suggestions?
--
Lon Sarnoff
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Auto_open not executing

Hi Lon,

See VBA help on the RunAutoMacros method.

The following worked for me:

Sub aMacro()
Workbooks.Open "MyTest.xls"
ActiveWorkbook.RunAutoMacros xlAutoOpen
End Sub

---
Regards,
Norman



"Lon Sarnoff" wrote in message
...
I have created an Auto_Open sub which does properly execute if the workbook
is opened via Windows. But if the same workbook is opened via a VBA
statement from within another workbook, the Auto_Open does not execute
even
though the workbook in fact is opened.

Any suggestions?
--
Lon Sarnoff



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Auto_open not executing

The activeworkbook line solved the problem. Thank you.
--
Lon Sarnoff


"Norman Jones" wrote:

Hi Lon,

See VBA help on the RunAutoMacros method.

The following worked for me:

Sub aMacro()
Workbooks.Open "MyTest.xls"
ActiveWorkbook.RunAutoMacros xlAutoOpen
End Sub

---
Regards,
Norman



"Lon Sarnoff" wrote in message
...
I have created an Auto_Open sub which does properly execute if the workbook
is opened via Windows. But if the same workbook is opened via a VBA
statement from within another workbook, the Auto_Open does not execute
even
though the workbook in fact is opened.

Any suggestions?
--
Lon Sarnoff




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Auto_open not executing

Take a look at .runautomacros in VBA's help. (You have to run that other
auto_open sub yourself.)

Lon Sarnoff wrote:

I have created an Auto_Open sub which does properly execute if the workbook
is opened via Windows. But if the same workbook is opened via a VBA
statement from within another workbook, the Auto_Open does not execute even
though the workbook in fact is opened.

Any suggestions?
--
Lon Sarnoff


--

Dave Peterson
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
Auto_open and more.... pcor New Users to Excel 2 December 1st 06 02:07 AM
Auto_open and more.... Mike New Users to Excel 0 November 30th 06 07:13 PM
Auto_open dan Excel Discussion (Misc queries) 7 May 21st 06 10:41 AM
XLA auto_open jc Excel Programming 0 October 6th 04 12:50 AM
Beyond AUTO_OPEN WarrenR Excel Programming 2 February 27th 04 03:57 AM


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