Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Automation Add-in Distribution problem


I have made an VB6.0 automation add-in and using it in the excle 2003
spreadsheet to do some calculations.

It seems to be working fine in my machine but when I try to use it in
some other machine, the add-in is not getting added in the excel
automaticaly, even though I register DLL in the new machine.

I have to manually open the excel and add the add-in from the menu item
and check the add-in to work.

I tried to then add in programatically in the onload of the workbook

Set addinXL = Excel.AddIns.Add("MyAddIn.Connect")

but it also does not seem to be working properly the first time.

What is the best way to distribute the add-in and the excel sheet to
others ?
How to install the add-in and the excel spreadshseet and make it work
on a clean machine.

Any help in this regard is appreciated.


--
kumar_8675
------------------------------------------------------------------------
kumar_8675's Profile: http://www.excelforum.com/member.php...o&userid=15693
View this thread: http://www.excelforum.com/showthread...hreadid=275507

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default Automation Add-in Distribution problem

Kumar,

This might help with a bit of tweaking. This is how I install an normal
add-in from a vb6 exe file. I haven't tested it with a dll, but I did try it
with an ocx that is already registered and it seemed to work.

Sub InstallAddIn
Dim strAddInPath As String
Dim oAddin As Object
Dim oXL As Object
Dim lReturn As Long
Dim nExcelCount As Integer

nExcelCount = 0

TestForExcel:
On Error Resume Next
Set oXL = GetObject(, "Excel.Application")
On Error GoTo 0

If Not (oXL Is Nothing) Then

If nExcelCount = 0 Then

Call MsgBox("Please save any files and quit Microsoft Excel then
press OK", _
vbOKOnly, msgTitle)

Else

Call MsgBox("You still have Excel running. To register this add-in
with Excel " & _
"you need to exit Excel first" & vbCrLf & vbCrLf & _
"If you can't see a running instance of Excel you may have a
hidden instance running" & vbCrLf & vbCrLf & _
"To close a hidden instance, press ALT-CTRL-DEL and remove Excel
from the list of running processes", _
vbOKOnly + vbInformation, msgTitle)

End If

nExcelCount = nExcelCount + 1
Set oXL = Nothing
GoTo TestForExcel

End If

Set oXL = CreateObject("Excel.Application")
'add a book or the add method fails
oXL.Workbooks.Add
strAddInPath= "full path to your file"
Set oAddin = oXL.addins.Add(strAddInPath)
oAddin.installed = True

oXL.Quit
Set oXL = Nothing
End Sub

Robin Hammond
www.enhanceddatasystems.com


"kumar_8675" wrote in message
...

I have made an VB6.0 automation add-in and using it in the excle 2003
spreadsheet to do some calculations.

It seems to be working fine in my machine but when I try to use it in
some other machine, the add-in is not getting added in the excel
automaticaly, even though I register DLL in the new machine.

I have to manually open the excel and add the add-in from the menu item
and check the add-in to work.

I tried to then add in programatically in the onload of the workbook

Set addinXL = Excel.AddIns.Add("MyAddIn.Connect")

but it also does not seem to be working properly the first time.

What is the best way to distribute the add-in and the excel sheet to
others ?
How to install the add-in and the excel spreadshseet and make it work
on a clean machine.

Any help in this regard is appreciated.


--
kumar_8675
------------------------------------------------------------------------
kumar_8675's Profile:
http://www.excelforum.com/member.php...o&userid=15693
View this thread: http://www.excelforum.com/showthread...hreadid=275507



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
Problem with excel macro - getting automation error [email protected] Charts and Charting in Excel 3 October 24th 07 05:22 PM
Excel 2003 c++ automation problem. Ken Excel Worksheet Functions 0 January 9th 07 12:13 AM
Access to Excel Automation ADODB Problem Matt Slattery Excel Programming 2 September 29th 04 12:59 PM
TypeConverter Excel-Automation problem Markus Excel Programming 0 August 23rd 04 11:17 AM
Problem with quitting Excel opened through automation Michelle Excel Programming 2 January 8th 04 06:54 PM


All times are GMT +1. The time now is 06:14 PM.

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"