Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Assigining User Defined Functions to Categories in Addins | Excel Worksheet Functions | |||
Calling functions from dll | Excel Programming | |||
Calling Add-in functions from VBA | Excel Programming | |||
Calling certain functions within VBA | Excel Programming | |||
Calling certain functions within VBA | Excel Programming |