Excel Add-In RegisterXLL

Reply

Join Date: Dec 2006
Posts: 2
Reputation: bud594 is an unknown quantity at this point 
Solved Threads: 0
bud594 bud594 is offline Offline
Newbie Poster

Excel Add-In RegisterXLL

 
0
  #1
Dec 29th, 2006
I seem to have an intermittent issue with the following code segment. I am installing an application which has an associated excel add in which I register and then run the on open macro. The formula then calls one of the functions from the add-in.

The script fails at the RegisterXLL step, reporting "AttributeError: Excel.Application.RegisterXLL", and then after failing for a number of times it will succeed until I reboot after which time it will commence failing again for a number of iterations following which it will work.

If I run the script and let it fail and then comment out the install step the script works.

This is running on both Win2K and WinXP o/s and both Excel 2000 and 2003. Any ideas gratefully received.
  1. import os
  2. from win32com.client import Dispatch
  3. os.system (install "setup.exe" in silent mode)
  4. xlApp = Dispatch("Excel.Application")
  5. xlApp.RegisterXLL(xll)
  6. xlApp.Visible = 1
  7. wb=xlApp.Workbooks.Add()
  8. xlApp.Workbooks.Open(xla).RunAutoMacros(1)
  9. xlApp.ActiveSheet.Cells(1,1).Formula = '=xversion()'
  10. wb.Close(SaveChanges=0)
  11. xlApp.Quit()
  12. xlApp.Visible = 0
  13. del xlApp
  14. os.system (uninstall "setup.exe" in silent mode)
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 3,858
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 867
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Re: Excel Add-In RegisterXLL

 
0
  #2
Dec 30th, 2006
Where does the variable xll come from?
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 2
Reputation: bud594 is an unknown quantity at this point 
Solved Threads: 0
bud594 bud594 is offline Offline
Newbie Poster

Re: Excel Add-In RegisterXLL

 
0
  #3
Dec 30th, 2006
xll is the full path of the xll file and xla is the full path of the xla file.

I am a little confused though, even with the xlApp.Quit() and del xlApp there is still an excel.exe visible in the taks manager. If this is running before the script starts then it works, if it is not then it fails.


Originally Posted by vegaseat View Post
Where does the variable xll come from?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Python Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC