View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tammy[_5_] Tammy[_5_] is offline
external usenet poster
 
Posts: 3
Default Problems creating a dll in Excel 2003 using addin designer

I have an Excel addin which I need to distribute so have created a com
addin using the addin designer. After much searching in Groups I have
it at the stage where it creates the buttons it needs to when Excel is
opened. I've copied the forms, modules and class modules from my xla
file into the addin but am having trouble getting the code to work
when it's called by the relevant button. (ie I have code that will
only run if a workbook is open. When I run it in Excel with a
workbook open it returns 0 as the workbook count.)

I think it's because when the code runs it's creating a new instance
of excel.exe and referring to that rather than the current instance.
When I check in task manager when I first open Excel there's one
Excel.exe yet when I run this macro there's two.

I copied some of the code into VB6 so I could debug it and found that
if I added the getobject line (ie Set objXL = GetObject (,
"Excel.Application") it worked. Trouble is when I copy that code into
the addin project in Excel I get the "ActiveX Component cannot create
object" message. The project references Excel so I don't know why I'm
getting that message. Any suggestions would be really appreciated!!

The other problem I have which may be caused by the same thing is that
when I calls the dialogs(wddialogsfileopen).show line, it doesn't
appear until I've closed Excel! Again - any suggestions greatly
appreciated.

Tammy