Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default Question about references

From a sub routine in one workbook I want to call a public method that exists in a public subroutine within another workbook

The problem is that I don't want the user to have to manually add a reference to the called workbook before being able to make the call

The only way I have found to call from one workbook to another is to first select the called workbook in the VBA references dialog. Once manually referenced I can do something like workbook_with_manual_reference.the_public_method()

I am finding this is the case even when the called method exists within a workbook that is loaded as an add-in. Oddly enough, application events that are trapped within the add-in code get called regardless of whether the add-in is referenced or not

Is it possible to automatically create (late-bind) references to loaded workbooks? How do you do it? If it is possible then how do you late bind the called method such that the compiler does not complain about the missing reference while the dynamic reference is being created

Thank

Mark
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Question about references

I believe you can use Application.Run to do that. Type Application.Run into
the immediate window, put your cursor on Run, then hit F1 to view the Help
article on Run.

"Mark" wrote in message
...
From a sub routine in one workbook I want to call a public method that

exists in a public subroutine within another workbook.

The problem is that I don't want the user to have to manually add a

reference to the called workbook before being able to make the call.

The only way I have found to call from one workbook to another is to first

select the called workbook in the VBA references dialog. Once manually
referenced I can do something like
workbook_with_manual_reference.the_public_method() .

I am finding this is the case even when the called method exists within a

workbook that is loaded as an add-in. Oddly enough, application events that
are trapped within the add-in code get called regardless of whether the
add-in is referenced or not.

Is it possible to automatically create (late-bind) references to loaded

workbooks? How do you do it? If it is possible then how do you late bind
the called method such that the compiler does not complain about the missing
reference while the dynamic reference is being created.

Thanks

Mark



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
Help with converting a block of cells with Absolute and mixed references to relative references Vulcan Excel Worksheet Functions 3 December 13th 07 11:43 PM
How to rename references from range names to cell references Abbas Excel Discussion (Misc queries) 1 May 24th 06 06:18 PM
syntax question - cell references in VB code needyourhelp New Users to Excel 1 March 2nd 05 08:52 PM
Question about references Dan[_31_] Excel Programming 0 January 19th 04 02:08 AM
References question Haldun Alay[_2_] Excel Programming 0 July 17th 03 04:13 PM


All times are GMT +1. The time now is 03:44 PM.

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"