LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Error Autoloading Addin with UDFs

There are quite a few settings that require a visible workbook, your
MacroOptions is indeed one of these. If you need to run code in an installed
addin's open event that needs a visible workbook try running from the
Workbook_Open event. I find this runs after a normal visible workbook has
loaded which typically occurs when starting Excel. The Auto_Open routine of
an installed addin runs before any normal workbook loads.

Not sure why but the order of these open events is reversed for
non-installed addins and workbooks.

An alternative is to call the routine with the OnTime method, to run after a
normal workbook has loaded. There are scenarios when no normal workbook will
be loaded so the routine would still require an error handler.

Regards,
Peter T

"Jim" wrote in message
...
I found a solution to my problem which I never have seemed documented
anywhere. You can not access the Addin Manager in Excel unless you have a
work book opened. That is why my addin works when I load it using Tools -
Addin but does not work when I try and open Excel with the Addin
preinstalled. To get around this problem you can use the Workbooks.Add
command to create a workbook before Excel loads the Addin.

"Irina" wrote:

You can't change macro properties in hidden workbook.
There are several ways to solve your problem.
1. Set IsAddin property of your add-in workbook to off,
then using Object Browser edit macro properties, set IsAddin to on

again,
and save it.
2. Use FunCustomize.dll, which is freely available via Internet. It is

very
easy and convenient tool to add description and category to you UDFs(sub

or
functions)

"Jim" wrote:

I have an addin which contains several user defined functions. I am

using
the Application.MacroOptions command to assign the functions to custom
categories. An example is:

Application.MacroOptions Macro:="BaPeq", Category:="Miscellaneous

Functions"

The addin installs without any problems when loading the addin with

Excel
already opened using Tools.Addins. But when I try to have Excel

autoload the
addin every time Excel starts the I get the following error message:

Run-time error '1004'
Cannot edit a macro on a hidden workbook. Unhide the workbook using

the
unhide command.

Any suggestions on how to avoid this error message?



 
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
UDFs return #NAME error sometimes, other times, they work Dave F Excel Discussion (Misc queries) 4 September 21st 06 11:52 PM
3rd stupid question from newbie - autoloading userform mato nanjin Excel Programming 2 June 15th 06 09:58 PM
Addin out of range error Trux Excel Programming 2 August 19th 05 02:41 PM
Stop autoloading a New worksheet when starting Excel Jwhite Setting up and Configuration of Excel 2 June 21st 05 03:45 PM
Cannot copy addin locally error? R Avery[_2_] Excel Programming 2 May 21st 05 03:14 AM


All times are GMT +1. The time now is 10:05 AM.

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"