Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2006

Tip: Looking for answers? Try searching our database.

public subs across multiple projects

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lucas Karpiuk - 24 Aug 2006 22:27 GMT
i've got a procedure that i cannot seem to call from within another project
(both loaded via the Startup folder). it'll work if they're in the same
project, but different modules. aside from an instance of Option Private,
which i don't have, is there anything else that might cause this? (or is this
actually expected behaviour and i've just misunderstood the documentation...)

thanks!
quartz - 24 Aug 2006 22:25 GMT
Sorry, I think I misread your post in my first answer. To call a Subroutine
in another file you use the syntax:

Application.Run "'myDrive\myPath\myFileName.doc'!MySubrountine"

That's a double quote, then a single quote, the full path to the file, then
an exclamation, then your Public subroutine name.

HTH

> i've got a procedure that i cannot seem to call from within another project
> (both loaded via the Startup folder). it'll work if they're in the same
[quoted text clipped - 3 lines]
>
> thanks!
quartz - 24 Aug 2006 22:26 GMT
If you are trying to call a subroutine try using the keyword "Public" in
front of the name as in: Public Sub MyRoutineName()

"Public" makes it visible to all modules within the same file. "Private"
does the opposite.

Likewise, if a function use: Public Function MyFunctionName()

HTH

> i've got a procedure that i cannot seem to call from within another project
> (both loaded via the Startup folder). it'll work if they're in the same
[quoted text clipped - 3 lines]
>
> thanks!
Jezebel - 24 Aug 2006 23:11 GMT
Apart from the Call method, an alternative is to add to your project a
reference to the other project -- its public objects then become available
to your code.

> i've got a procedure that i cannot seem to call from within another
> project
[quoted text clipped - 6 lines]
>
> thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.