Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Addins - calling functions

Hi,

I have an addin which contains VBA code. I was wondering
how to call these functions from with the VBA of an open
workbook. e.g. to call my user defined save routine within
the xla.

Thanks for any help,

Steven
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Addins - calling functions

Try the following:

Private xlApp As New Excel.Application

Public Sub Main()
xlApp.Workbooks.Open "C:\Book1.xla"
xlApp.Run "Book1.xla!MyModule"
xlApp.Quit
Set xlApp = Nothing
End Sub


"Steven Revell" wrote in message
...
Hi,

I have an addin which contains VBA code. I was wondering
how to call these functions from with the VBA of an open
workbook. e.g. to call my user defined save routine within
the xla.

Thanks for any help,

Steven



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Addins - calling functions

You don't need to run a new instance of excel to run a function from an xla.
If it is loaded

Application.Run "Book1.xla!MyModule"

Should work fine.

If you set a reference to it (in the VBE, Tools=References), you can call
it just like the function is in the subject workbook.


MyModule


--
Regards,
Tom Ogilvy


"Kent Prokopy" wrote in message
...
Try the following:

Private xlApp As New Excel.Application

Public Sub Main()
xlApp.Workbooks.Open "C:\Book1.xla"
xlApp.Run "Book1.xla!MyModule"
xlApp.Quit
Set xlApp = Nothing
End Sub


"Steven Revell" wrote in message
...
Hi,

I have an addin which contains VBA code. I was wondering
how to call these functions from with the VBA of an open
workbook. e.g. to call my user defined save routine within
the xla.

Thanks for any help,

Steven





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
Assigining User Defined Functions to Categories in Addins Jim Excel Worksheet Functions 0 June 27th 06 12:09 PM
Calling functions from dll T.K Kullervo Excel Programming 0 September 29th 03 09:55 AM
Calling Add-in functions from VBA Mark[_21_] Excel Programming 5 September 12th 03 08:49 PM
Calling certain functions within VBA Myrna Larson[_2_] Excel Programming 0 August 11th 03 10:57 PM
Calling certain functions within VBA james Excel Programming 0 August 11th 03 10:27 PM


All times are GMT +1. The time now is 01:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"