Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Running code in opened workbook

I have an Excel application that during running opens another workbook which
has some VBA code. How can I run the code in this opened workbook?

At present my application workbook shows a 'sub or function not defined
error when I try to run the code.

' code in my first workbook
Sub ProcessOtherWorkBook

Workbooks.Open Filename:="C:\Accounts.xls"

Call ProcessAccounts <== error here sub or function not defined

End Sub


Cheers

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Running code in opened workbook

Thanks Don, simple when you know how!!

"Don Guillett" wrote:

Sub pow()
Workbooks.Open Filename:="yourfilename.xls"
Application.Run ("yourfilename.xls!yourmacroname")
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Nigel RS" wrote in message
...
I have an Excel application that during running opens another workbook
which
has some VBA code. How can I run the code in this opened workbook?

At present my application workbook shows a 'sub or function not defined
error when I try to run the code.

' code in my first workbook
Sub ProcessOtherWorkBook

Workbooks.Open Filename:="C:\Accounts.xls"

Call ProcessAccounts <== error here sub or function not defined

End Sub


Cheers



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
Same macro running from earlier opened workbook MAB Excel Programming 8 March 21st 07 09:13 PM
running code when vba project is opened Jay Excel Programming 0 September 19th 06 07:36 AM
Chart_Activate not running when workbook opened [email protected] Excel Programming 2 September 2nd 06 07:42 PM
Running code before any file is opened/saved Bill Schanks Excel Programming 2 April 14th 06 06:01 PM
Running of a Macro when Workbook is opened Darin Kramer Excel Programming 2 December 14th 04 01:06 PM


All times are GMT +1. The time now is 12:47 AM.

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

About Us

"It's about Microsoft Excel"