Author Topic: Calling a VBA sub from another VBA file  (Read 1918 times)

0 Members and 1 Guest are viewing this topic.

iliekater

  • Guest
Calling a VBA sub from another VBA file
« on: December 09, 2006, 12:28:42 PM »
Here's a funny question :
Lets say we have two VBA files . Is it possible from within the first application , to call a sub written in the second file ? That would be very useful to me since I wouldn't need to repeat the same code in every VBA application .

Bryco

  • Water Moccasin
  • Posts: 1883
Re: Calling a VBA sub from another VBA file
« Reply #1 on: December 09, 2006, 07:04:28 PM »
Try adding a reference to the other vba project, then you can use the subs by prefacing it with the project name

iliekater

  • Guest
Re: Calling a VBA sub from another VBA file
« Reply #2 on: December 10, 2006, 02:04:10 AM »
It was as simple as that ! That's why they called it Basic !