Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Problems creating a dll in Excel 2003 using addin designer

I've had some success since I posted this question and have actually
sorted out those problems (again thanks to more searching in Google
groups!). I needed to set the objXL variable as the application in
the onconnection procedure.

Have another problem now though. I need to use some of the functions
I've created in the dll in another excel template. I've set the
reference and have added the following code into the template.

Dim cAlemy As cAddin.cProcedures ''' Declare the variable
Set cAlemy = cAddin.GetProcedures()

The addin has code in the standard modules to instantiate the new
class

Public Function GetProcedures() As cProcedures
Set GetProcedures = New cProcedures
End Function

The class I'm trying to access is set to publicnotcreatable in the
instancing property.

The problem is the code debugs at .GetProcedures() in the
Set cAlemy = cAddin.GetProcedures() line saying that it can't find
method or member. I know it's probably something small I'm
overlooking but I'm new to this so any help would be great!

Cheers,
Tammy



(Tammy) wrote in message . com...
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

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
addin for analysis tool pak for excel 2003 ppp Excel Discussion (Misc queries) 1 October 22nd 06 09:36 AM
addin for analysis tool pak for excel 2003 ppp Excel Worksheet Functions 1 October 22nd 06 06:41 AM
addin problems Brian Z Excel Programming 0 October 14th 04 05:41 PM
Creating a new Excel Addin Michael Lawrence Jr. Excel Programming 1 December 17th 03 10:30 PM
Problems with Excel Com Addin Chip Pearson Excel Programming 1 August 9th 03 10:11 AM


All times are GMT +1. The time now is 07:11 AM.

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

About Us

"It's about Microsoft Excel"