| | |
Excel Add-In RegisterXLL
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Dec 2006
Posts: 2
Reputation:
Solved Threads: 0
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.
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.
Python Syntax (Toggle Plain Text)
import os from win32com.client import Dispatch os.system (install "setup.exe" in silent mode) xlApp = Dispatch("Excel.Application") xlApp.RegisterXLL(xll) xlApp.Visible = 1 wb=xlApp.Workbooks.Add() xlApp.Workbooks.Open(xla).RunAutoMacros(1) xlApp.ActiveSheet.Cells(1,1).Formula = '=xversion()' wb.Close(SaveChanges=0) xlApp.Quit() xlApp.Visible = 0 del xlApp os.system (uninstall "setup.exe" in silent mode)
•
•
Join Date: Dec 2006
Posts: 2
Reputation:
Solved Threads: 0
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.
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.
![]() |
Similar Threads
- Ouput in exel (VB.NET)
- VB - How to open an Excel Doc w/ existing data & add data in specific cells? (VB.NET)
- Problem formating VB string for clipboard (Visual Basic 4 / 5 / 6)
- How to write files to an Excel application (Visual Basic 4 / 5 / 6)
- Macros in Excel (Visual Basic 4 / 5 / 6)
Other Threads in the Python Forum
- Previous Thread: list in another list
- Next Thread: Newbie Help
| Thread Tools | Search this Thread |
alarm assignment avogadro beginner bluetooth character cmd code customdialog cx-freeze data decimals dictionary directory dynamic error examples exe file float format function generator gnu graphics gui halp homework http ideas import input itunes java leftmouse line linux list lists logging loop maintain maze module mouse mysqldb number numbers output parsing path port prime programming projects push py2exe pygame pyglet pyqt python queue random recursion schedule screensaverloopinactive script scrolledtext slicenotation sqlite ssh stdout string strings sudokusolver table terminal text thread threading time tkinter tlapse tuple tutorial ubuntu unicode urllib urllib2 variable variables ventrilo verify vigenere web webservice wikipedia windows wxpython xlib






