Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running code in opened workbook
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Same macro running from earlier opened workbook | Excel Programming | |||
running code when vba project is opened | Excel Programming | |||
Chart_Activate not running when workbook opened | Excel Programming | |||
Running code before any file is opened/saved | Excel Programming | |||
Running of a Macro when Workbook is opened | Excel Programming |