View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Steve Gailey Steve Gailey is offline
external usenet poster
 
Posts: 1
Default Problems with Excel Com Addin

Dim WithEvents moXL As Excel.Application
....
Private Sub AddinInstance_OnConnection(ByVal Application
As Object, ByVal ConnectMode As
AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As
Object, custom() As Variant)
Dim cbcpop As CommandBarControl
Dim cbRisk As CommandBarControl

Set moXL = Application
CreateBar
About.Show

End Sub
....


When I try to use moXL later, such as moXL.ActiveWorkbook
or moXL.Workbooks etc. I get Object Required error
messages.

The code I am trying is very close to what I have found on
Microsoft web sites and in books etc. so I guess I have
just made a stupid mistake someplace... Am I doing the
right thing though?

Steve

-----Original Message-----
Steve,

Specifically what problems are you having? Perhaps you

could post
some sample code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Steve Gailey" wrote

in message
...
I am converting an XLA to a com addin and I am having
problems referencing the Active Workbook and Active
Worksheet.

I have saved a reference to "Application" in

OnConnection,
but referencing this doesn't seem to help. Any

suggestions?

Steve



.