PC Review


Reply
Thread Tools Rate Thread

Automation add-in (UDF) not loading when Excel invoked programatic

 
 
Andrew Wiles
Guest
Posts: n/a
 
      21st Jun 2008
I am attempting to automate a process that creates a series of workbooks each
with a different subset of data populated. The basic process is running fine
however I have a number of user defined functions (UDF's) implemented via an
automation add-in. If I load my newly created workbooks programatically using

Excel._Application excelApp = new
Microsoft.Office.Interop.Excel.Application();
Excel.Workbook doc = excelApp.Workbooks.Open(myFile, missing, missing,
missing, missing, missing, missing, missing, missing, missing, missing,
missing, missing,missing, missing);

My udf's are not recognized and return #NAME?

When I open the workbooks in a normal Excel session launched from the start
menu they behave correctly.

It would appear that I need to do something to force the automation dll to
load in this scenario?

Any help would be appreciated.

Regards

Andrew Wiles
 
Reply With Quote
 
 
 
 
Mark Ivey
Guest
Posts: n/a
 
      21st Jun 2008
Take a look at these sites:

http://www.xtremevbtalk.com/archive/.../t-153129.html

http://support.microsoft.com/default...b;en-us;270844
http://support.microsoft.com/default...b;en-us;213489
http://support.microsoft.com/default...b;en-us;108888

Mark Ivey

"Andrew Wiles" <(E-Mail Removed)> wrote in message
news:A919158F-CCE2-4357-B1C8-(E-Mail Removed)...
> I am attempting to automate a process that creates a series of workbooks
> each
> with a different subset of data populated. The basic process is running
> fine
> however I have a number of user defined functions (UDF's) implemented via
> an
> automation add-in. If I load my newly created workbooks programatically
> using
>
> Excel._Application excelApp = new
> Microsoft.Office.Interop.Excel.Application();
> Excel.Workbook doc = excelApp.Workbooks.Open(myFile, missing, missing,
> missing, missing, missing, missing, missing, missing, missing, missing,
> missing, missing,missing, missing);
>
> My udf's are not recognized and return #NAME?
>
> When I open the workbooks in a normal Excel session launched from the
> start
> menu they behave correctly.
>
> It would appear that I need to do something to force the automation dll to
> load in this scenario?
>
> Any help would be appreciated.
>
> Regards
>
> Andrew Wiles


 
Reply With Quote
 
Andrew Wiles
Guest
Posts: n/a
 
      22nd Jun 2008
Mark

Thanks for the links, I had come accross a coupl of these in my initial
searches. These links seem primarily to deal with xll add-ins. What I have is
a dll. To be more precise about the behaviour I am seeing the add-in is
recognised in the COMAddins collection of the Excel application but it does
not appear that the udfs have been loaded.

I have actually solved my problem by taking a different approach in which I
re-use the primary Excel session that the user launched from the desktop
rather than creating new instances but I would still be interested in finding
out why the udf's are not available.



"Mark Ivey" wrote:

> Take a look at these sites:
>
> http://www.xtremevbtalk.com/archive/.../t-153129.html
>
> http://support.microsoft.com/default...b;en-us;270844
> http://support.microsoft.com/default...b;en-us;213489
> http://support.microsoft.com/default...b;en-us;108888
>
> Mark Ivey
>
> "Andrew Wiles" <(E-Mail Removed)> wrote in message
> news:A919158F-CCE2-4357-B1C8-(E-Mail Removed)...
> > I am attempting to automate a process that creates a series of workbooks
> > each
> > with a different subset of data populated. The basic process is running
> > fine
> > however I have a number of user defined functions (UDF's) implemented via
> > an
> > automation add-in. If I load my newly created workbooks programatically
> > using
> >
> > Excel._Application excelApp = new
> > Microsoft.Office.Interop.Excel.Application();
> > Excel.Workbook doc = excelApp.Workbooks.Open(myFile, missing, missing,
> > missing, missing, missing, missing, missing, missing, missing, missing,
> > missing, missing,missing, missing);
> >
> > My udf's are not recognized and return #NAME?
> >
> > When I open the workbooks in a normal Excel session launched from the
> > start
> > menu they behave correctly.
> >
> > It would appear that I need to do something to force the automation dll to
> > load in this scenario?
> >
> > Any help would be appreciated.
> >
> > Regards
> >
> > Andrew Wiles

>

 
Reply With Quote
 
Fredrik
Guest
Posts: n/a
 
      11th Sep 2008
I'm having the exact same problem, and I don't have the luxury to re-use the
primary Excel session. Has anyone found a solution for this?

Thanks!
/Fredrik

"Andrew Wiles" wrote:

> Mark
>
> Thanks for the links, I had come accross a coupl of these in my initial
> searches. These links seem primarily to deal with xll add-ins. What I have is
> a dll. To be more precise about the behaviour I am seeing the add-in is
> recognised in the COMAddins collection of the Excel application but it does
> not appear that the udfs have been loaded.
>
> I have actually solved my problem by taking a different approach in which I
> re-use the primary Excel session that the user launched from the desktop
> rather than creating new instances but I would still be interested in finding
> out why the udf's are not available.
>
>
>
> "Mark Ivey" wrote:
>
> > Take a look at these sites:
> >
> > http://www.xtremevbtalk.com/archive/.../t-153129.html
> >
> > http://support.microsoft.com/default...b;en-us;270844
> > http://support.microsoft.com/default...b;en-us;213489
> > http://support.microsoft.com/default...b;en-us;108888
> >
> > Mark Ivey
> >
> > "Andrew Wiles" <(E-Mail Removed)> wrote in message
> > news:A919158F-CCE2-4357-B1C8-(E-Mail Removed)...
> > > I am attempting to automate a process that creates a series of workbooks
> > > each
> > > with a different subset of data populated. The basic process is running
> > > fine
> > > however I have a number of user defined functions (UDF's) implemented via
> > > an
> > > automation add-in. If I load my newly created workbooks programatically
> > > using
> > >
> > > Excel._Application excelApp = new
> > > Microsoft.Office.Interop.Excel.Application();
> > > Excel.Workbook doc = excelApp.Workbooks.Open(myFile, missing, missing,
> > > missing, missing, missing, missing, missing, missing, missing, missing,
> > > missing, missing,missing, missing);
> > >
> > > My udf's are not recognized and return #NAME?
> > >
> > > When I open the workbooks in a normal Excel session launched from the
> > > start
> > > menu they behave correctly.
> > >
> > > It would appear that I need to do something to force the automation dll to
> > > load in this scenario?
> > >
> > > Any help would be appreciated.
> > >
> > > Regards
> > >
> > > Andrew Wiles

> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
loading automation add-in for an instance of Excel Smallweed Microsoft Excel Programming 1 23rd Jan 2008 04:53 PM
Automation error. The object invoked has disconnected =?Utf-8?B?R3Jhbm55TQ==?= Microsoft Excel Programming 10 11th Apr 2007 07:06 PM
Automation Error : The Object Invoked Has Disconnected From Its Clients !! donna.gough@hydro.com Microsoft Excel Programming 3 17th Jun 2005 01:17 PM
Automation Error: The object invoked has disconnected from its Clients =?Utf-8?B?SmFja2llIEJsYW5k?= Microsoft Excel Crashes 0 5th Feb 2004 02:11 PM
Automation Error: The Object Invoked Has Disconnected from Its Clients (Excel) Vaibhav Microsoft Excel Programming 0 8th Sep 2003 04:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:42 PM.