Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Add-In Automation Fails in Excel 2000

And wouldn't you want to avoid the possible error:

Option Explicit
Public Sub InstallAddIn()

Dim xlApp As Application 'As Object
Dim xlAddIn As AddIn 'as Object

Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True 'for testing

xlApp.Workbooks.Add

On Error Resume Next
Set xlAddIn = xlApp.AddIns.Add("C:\XXX.xla", True)
If Err.Number = 0 Then
xlAddIn.Installed = True
End If
On Error GoTo 0

xlApp.Quit
Set xlApp = Nothing

End Sub

If you're running this from excel, I'm not sure why you want to start a new
excel application, though.

But if you're running this from a VBS file (testing via excel???), then I broke
your declarations.


jean grey wrote:

Hi, everyone. I need some help why the ff. code does not succeed:

Public Sub InstallAddIn()

Dim xlApp, xlAddIn

Set xlApp = CreateObject ("Excel.Application")
xlApp.Workbooks.Add
xlAddIn = xlApp.AddIns.Add("C:\XXX.xla", True)
If Err.Number = 0 Then
xlAddIn.Installed = True
End If
xlApp.Quit
Set xlApp = Nothing

End Sub

This installs the add-in in Excel 2003 but not in Excel 2000.
It generates an error when calling xlAddIn = xlApp.AddIns.Add("C:\XXX.xla",
True)

I don't know how to modify the code using the suggested link below from
other forums:

http://support.microsoft.com/kb/213489/

Thanks in advance.


--

Dave Peterson
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Add-In Automation Fails in Excel 2000

Thanks, guys for your suggestions.
I'm running the code from an external vbscript which is used to
automatically add the Add-in in Excel's Add-In Manager (somehow like an
installer).
You were right at some point. There's nothing wrong with my code.
Aside from the XLA, which had no problem registering, I have an XLL file and
found out that it was the one that fails to register. I also noticed that the
add-in is registered when there is Visual Studio installed, but it fails
when there's none.
Does anyone here know which lib or dll from Visual Studio should be included
in the build path?

Thanks.

"Dave Peterson" wrote:

And wouldn't you want to avoid the possible error:

Option Explicit
Public Sub InstallAddIn()

Dim xlApp As Application 'As Object
Dim xlAddIn As AddIn 'as Object

Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True 'for testing

xlApp.Workbooks.Add

On Error Resume Next
Set xlAddIn = xlApp.AddIns.Add("C:\XXX.xla", True)
If Err.Number = 0 Then
xlAddIn.Installed = True
End If
On Error GoTo 0

xlApp.Quit
Set xlApp = Nothing

End Sub

If you're running this from excel, I'm not sure why you want to start a new
excel application, though.

But if you're running this from a VBS file (testing via excel???), then I broke
your declarations.


jean grey wrote:

Hi, everyone. I need some help why the ff. code does not succeed:

Public Sub InstallAddIn()

Dim xlApp, xlAddIn

Set xlApp = CreateObject ("Excel.Application")
xlApp.Workbooks.Add
xlAddIn = xlApp.AddIns.Add("C:\XXX.xla", True)
If Err.Number = 0 Then
xlAddIn.Installed = True
End If
xlApp.Quit
Set xlApp = Nothing

End Sub

This installs the add-in in Excel 2003 but not in Excel 2000.
It generates an error when calling xlAddIn = xlApp.AddIns.Add("C:\XXX.xla",
True)

I don't know how to modify the code using the suggested link below from
other forums:

http://support.microsoft.com/kb/213489/

Thanks in advance.


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Add-In Automation Fails in Excel 2000

Are you using the RegisterXLL function to register your XLL.

Not sure why you need Visual studio installed as you haven't given any
details. Also not sure what you are asking re build path.

Regards,
Peter T

"jean grey" wrote in message
...
Thanks, guys for your suggestions.
I'm running the code from an external vbscript which is used to
automatically add the Add-in in Excel's Add-In Manager (somehow like an
installer).
You were right at some point. There's nothing wrong with my code.
Aside from the XLA, which had no problem registering, I have an XLL file
and
found out that it was the one that fails to register. I also noticed that
the
add-in is registered when there is Visual Studio installed, but it fails
when there's none.
Does anyone here know which lib or dll from Visual Studio should be
included
in the build path?

Thanks.

"Dave Peterson" wrote:

And wouldn't you want to avoid the possible error:

Option Explicit
Public Sub InstallAddIn()

Dim xlApp As Application 'As Object
Dim xlAddIn As AddIn 'as Object

Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True 'for testing

xlApp.Workbooks.Add

On Error Resume Next
Set xlAddIn = xlApp.AddIns.Add("C:\XXX.xla", True)
If Err.Number = 0 Then
xlAddIn.Installed = True
End If
On Error GoTo 0

xlApp.Quit
Set xlApp = Nothing

End Sub

If you're running this from excel, I'm not sure why you want to start a
new
excel application, though.

But if you're running this from a VBS file (testing via excel???), then I
broke
your declarations.


jean grey wrote:

Hi, everyone. I need some help why the ff. code does not succeed:

Public Sub InstallAddIn()

Dim xlApp, xlAddIn

Set xlApp = CreateObject ("Excel.Application")
xlApp.Workbooks.Add
xlAddIn = xlApp.AddIns.Add("C:\XXX.xla", True)
If Err.Number = 0 Then
xlAddIn.Installed = True
End If
xlApp.Quit
Set xlApp = Nothing

End Sub

This installs the add-in in Excel 2003 but not in Excel 2000.
It generates an error when calling xlAddIn =
xlApp.AddIns.Add("C:\XXX.xla",
True)

I don't know how to modify the code using the suggested link below from
other forums:

http://support.microsoft.com/kb/213489/

Thanks in advance.


--

Dave Peterson



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Add-In Automation Fails in Excel 2000

I found out the cause of the error. The path of the XLL file should be added
to the system's environment variables because the XLL file is using another
DLL located at the same folder.

Anyway, thanks guys. :)

"Peter T" wrote:

Are you using the RegisterXLL function to register your XLL.

Not sure why you need Visual studio installed as you haven't given any
details. Also not sure what you are asking re build path.

Regards,
Peter T

"jean grey" wrote in message
...
Thanks, guys for your suggestions.
I'm running the code from an external vbscript which is used to
automatically add the Add-in in Excel's Add-In Manager (somehow like an
installer).
You were right at some point. There's nothing wrong with my code.
Aside from the XLA, which had no problem registering, I have an XLL file
and
found out that it was the one that fails to register. I also noticed that
the
add-in is registered when there is Visual Studio installed, but it fails
when there's none.
Does anyone here know which lib or dll from Visual Studio should be
included
in the build path?

Thanks.

"Dave Peterson" wrote:

And wouldn't you want to avoid the possible error:

Option Explicit
Public Sub InstallAddIn()

Dim xlApp As Application 'As Object
Dim xlAddIn As AddIn 'as Object

Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True 'for testing

xlApp.Workbooks.Add

On Error Resume Next
Set xlAddIn = xlApp.AddIns.Add("C:\XXX.xla", True)
If Err.Number = 0 Then
xlAddIn.Installed = True
End If
On Error GoTo 0

xlApp.Quit
Set xlApp = Nothing

End Sub

If you're running this from excel, I'm not sure why you want to start a
new
excel application, though.

But if you're running this from a VBS file (testing via excel???), then I
broke
your declarations.


jean grey wrote:

Hi, everyone. I need some help why the ff. code does not succeed:

Public Sub InstallAddIn()

Dim xlApp, xlAddIn

Set xlApp = CreateObject ("Excel.Application")
xlApp.Workbooks.Add
xlAddIn = xlApp.AddIns.Add("C:\XXX.xla", True)
If Err.Number = 0 Then
xlAddIn.Installed = True
End If
xlApp.Quit
Set xlApp = Nothing

End Sub

This installs the add-in in Excel 2003 but not in Excel 2000.
It generates an error when calling xlAddIn =
xlApp.AddIns.Add("C:\XXX.xla",
True)

I don't know how to modify the code using the suggested link below from
other forums:

http://support.microsoft.com/kb/213489/

Thanks in advance.

--

Dave Peterson




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
VBA code runs in Excel 2003, fails in 2000 Andrew[_56_] Excel Programming 1 October 16th 07 07:34 PM
Excel 2000 webquery fails for pages greater than 2k [email protected] Excel Programming 1 August 11th 06 06:17 AM
Activate method of Worksheet class fails in Excel 2000 Chris Bloom Excel Discussion (Misc queries) 3 September 10th 05 12:05 AM
Excel fails to open workbook using Automation from VB 6 Lowell Excel Programming 0 September 8th 05 05:33 AM
Excel 2000 Automation Error Felix[_2_] Excel Programming 0 September 18th 03 04:56 AM


All times are GMT +1. The time now is 10:32 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"