How can i include a .vbs file in another .vbs file

  • Thread starter Store a reference of a excel workbook
  • Start date
S

Store a reference of a excel workbook

I have created a library of common functions and named it "functions.vbs".
Now i wanted to include it in other vbs files so that i can use functions
defined in it. Please tell me the way to do it.
 
D

Dave Peterson

Did you mean to post a question about .vbs files in a forum dedicated to excel?
 
S

Store a reference of a excel workbook

Hi Dave,

Actually i have created a lot of common excel functions that can be used
later and stored them in a vbs file (just for modularity). Now i wanted to
know the way to call those excel functions from the other vbs files.
 
D

Dave Peterson

I'd just open the text file (VBA code, not VBS code!) and then copy|paste into a
module inside the VBE.

But just as you can export modules as .BAS files (that's the normal suffix), you
can import those .bas (or other text files).

Read Chip Pearson's page:
http://www.cpearson.com/excel/vbe.aspx

If I have common procedures that I want available each time I open excel (not
just a repository for the code), I'd create another workbook (saved as an
Addin???) and have that open with excel.
 
Top