Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default How to reference code located in an Add-in File

What is the correct syntax for calling a VBA subroutine or function that
exists in a code module the resides in an Excel add-in file? Does the
calling syntax need to state the name of the code module where the called
code is located?

Thanks,

Keith



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default How to reference code located in an Add-in File

In article ,
says...
What is the correct syntax for calling a VBA subroutine or function that
exists in a code module the resides in an Excel add-in file? Does the
calling syntax need to state the name of the code module where the called
code is located?

Thanks,

Keith




For a couple of examples see
How to use a class (object) from outside of the VBA project in which it
is declared
http://support.microsoft.com/default...b;en-us;555159

Don't worry about the class module stuff. Just focus on how the
function New_clsEmployee is called, especially the use of single quotes
in the file name.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default How to reference code located in an Add-in File

Thank you for answering. I read the article and it was helpful; however, I'm
still having a problem.
I have an add in named mapper.xla. I want to use the "'mapper.xla'!Sheet1"
Worksheet_Activate subroutine to run worksheet activation code for the
workbook that has the mapper.xla attachment. So far, nothing that I have
tried seems to work. Any suggestions?

Thanks,

Keith


"Tushar Mehta" wrote in message
om...
In article ,
says...
What is the correct syntax for calling a VBA subroutine or function that
exists in a code module the resides in an Excel add-in file? Does the
calling syntax need to state the name of the code module where the called
code is located?

Thanks,

Keith




For a couple of examples see
How to use a class (object) from outside of the VBA project in which it
is declared
http://support.microsoft.com/default...b;en-us;555159

Don't worry about the class module stuff. Just focus on how the
function New_clsEmployee is called, especially the use of single quotes
in the file name.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default How to reference code located in an Add-in File

You cannot access private event procedures in sheet modules in other
workbooks. If you wrote the add-in, consider making the code in the
event procedure part of a application level event procedure. For more
see XL VBA help for 'Using Events with the Application Object' (w/o the
quotes). It's a bit more work up front but the benefits more than make
up for it.

I never use worksheet or workbook level event procedures in any real
code I write. It's just bad form.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Thank you for answering. I read the article and it was helpful; however, I'm
still having a problem.
I have an add in named mapper.xla. I want to use the "'mapper.xla'!Sheet1"
Worksheet_Activate subroutine to run worksheet activation code for the
workbook that has the mapper.xla attachment. So far, nothing that I have
tried seems to work. Any suggestions?

Thanks,

Keith


"Tushar Mehta" wrote in message
om...
In article ,

says...
What is the correct syntax for calling a VBA subroutine or function that
exists in a code module the resides in an Excel add-in file? Does the
calling syntax need to state the name of the code module where the called
code is located?

Thanks,

Keith




For a couple of examples see
How to use a class (object) from outside of the VBA project in which it
is declared
http://support.microsoft.com/default...b;en-us;555159

Don't worry about the class module stuff. Just focus on how the
function New_clsEmployee is called, especially the use of single quotes
in the file name.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to reference code located in an Add-in File

You can also see Chip Pearson's site for a page on application level events

http://www.cpearson.com/excel/appevent.htm



--
Regards,
Tom Ogilvy

"keithb" wrote in message
...
Thank you for answering. I read the article and it was helpful; however,

I'm
still having a problem.
I have an add in named mapper.xla. I want to use the "'mapper.xla'!Sheet1"
Worksheet_Activate subroutine to run worksheet activation code for the
workbook that has the mapper.xla attachment. So far, nothing that I have
tried seems to work. Any suggestions?

Thanks,

Keith


"Tushar Mehta" wrote in message
om...
In article ,
says...
What is the correct syntax for calling a VBA subroutine or function

that
exists in a code module the resides in an Excel add-in file? Does the
calling syntax need to state the name of the code module where the

called
code is located?

Thanks,

Keith




For a couple of examples see
How to use a class (object) from outside of the VBA project in which it
is declared
http://support.microsoft.com/default...b;en-us;555159

Don't worry about the class module stuff. Just focus on how the
function New_clsEmployee is called, especially the use of single quotes
in the file name.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions





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 me find a circular reference cells located in unknown multita John7100 Excel Discussion (Misc queries) 2 April 30th 10 01:55 AM
I need to open a file in excel located on another computer P.Grieshop[_2_] Excel Discussion (Misc queries) 0 March 18th 10 03:10 PM
Code in one workbook to call code in another XL file [email protected] Excel Programming 2 August 1st 05 03:37 PM
Import VBA Code in Excel-File ? (Export VBA Code to file) Matthias Pospiech Excel Programming 2 March 22nd 05 04:56 PM
OPENING A FILE LOCATED IN A DIRECTORY DIFFERENT FROM CURRENT DIRECTORS Steven R. Berke Excel Programming 1 July 25th 03 04:49 PM


All times are GMT +1. The time now is 11:43 AM.

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"