Steven Matuszak


I have several hidden workbooks loaded at startup that contain excel macros used to modify certain special workbooks. I also have a number of modules that are universal and contain procedures and functions I'd like to use in any project that I load. The file containing common modules is S.XLS and special workbooks C.XLS and D.XLS VB for Excel recognizes each sheet as a project. As I read the on-line help, to refer to procedure TestSub in module MySubs in Project S.XLS from procedures in project C.XLS the code would be:

sub UseTestSub

[S.XLS].[MySubs].TestSub

end sub

This produces an error that the file doesn't exist. Is there a correct way to access SUBs and Functions from another project

Should I be doing something different with my standard procedures in S.XLS to load them for use by procedures in any other projects




Re: Visual Basic for Excel

DMan1


Moved to VBA forum





Re: Visual Basic for Excel

Jon Peltier

There are a variety of ways to handle this. You could set a reference to S.XLS in any special workbook which uses its procedures. Or you could call the procedures using

Application.Run "S.XLS!TestSub"
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______






Re: Visual Basic for Excel

Steven Matuszak

Could you tell me more about "setting a reference to S.xls". S.xls contains a lot of my standard procedures and functions that I'd like to be able to use in other projects.



Re: Visual Basic for Excel

Jon Peltier

In the VB Editor, select References from the Tools menu, and check the box in front of the appropriate project.

- Jon 
------- 
Jon Peltier, Microsoft Excel MVP 
Tutorials and Custom Solutions 
http://PeltierTech.com 
_______