ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   run code in other workbook (https://www.excelbanter.com/excel-programming/326496-run-code-other-workbook.html)

Saladin

run code in other workbook
 
Hi

I can open a second workbook in code but can not manage to run a proc within
the second book (from the first book). I've made second book code Public.
Something like workbooks("answers.xls").pastry doesn't work (where pastry is
Public proc). Does this make sense?

How to please?

Thanks!
Graeme



Rowan[_2_]

run code in other workbook
 
Try

Application.Run "answers!pastry"

"Saladin" wrote:

Hi

I can open a second workbook in code but can not manage to run a proc within
the second book (from the first book). I've made second book code Public.
Something like workbooks("answers.xls").pastry doesn't work (where pastry is
Public proc). Does this make sense?

How to please?

Thanks!
Graeme




OJ[_2_]

run code in other workbook
 
I think that should read...

Application.Run "answers.xls!Pastry"

I think you need the file extension....
OJ


Saladin

run code in other workbook
 
thanks both. that's great!
"OJ" wrote in message
ups.com...
I think that should read...

Application.Run "answers.xls!Pastry"

I think you need the file extension....
OJ





All times are GMT +1. The time now is 05:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com