Hello, I recently upgraded to 32-bit windows 7.
For some reason, I am getting an automation error when i try to run my excel VBA script to call my Python COM server. Here's the script for the python COM server. This is creating a COM server to watermark a PDF. import pythoncom class PythonUtilities: _public_methods_ = [ 'add_watermark' ] _reg_progid_ = "PythonDemo.Utilities" # NEVER copy the following ID # Use "print pythoncom.CreateGuid()" to make a new one. _reg_clsid_ = "{B7E3EE50-5E2A-4044-8241-4F76B1DAB894}" def add_watermark(self, pdf_input_path, watermark_string, pdf_output_path): import StringIO from pyPdf import PdfFileReader, PdfFileWriter from reportlab.pdfgen import canvas output = PdfFileWriter() #create watermark packet = StringIO.StringIO() c = canvas.Canvas(packet) c.drawString(500,750,watermark_string) c.save() packet.seek(0) watermark = PdfFileReader(packet) input = PdfFileReader(file(pdf_input_path, "rb")) pdf_path_page_count = input.getNumPages() print pdf_path_page_count for page in range(pdf_path_page_count): print page current_page = input.getPage(page) current_page.mergePage(watermark.getPage(0)) output.addPage(input.getPage(page)) outputStream = file(pdf_output_path, "wb") output.write(outputStream) outputStream.close() # Add code so that when this script is run by # Python.exe, it self-registers. if __name__=='__main__': print "Registering COM server..." import win32com.server.register win32com.server.register.UseCommandLine(PythonUtilities) In Excel VBA, when i try to run Set PythonUtils = CreateObject("PythonDemo.Utilities") i get an automation error stating that the module cannot be found. Looking around on the web, i see that Diego had a similar issue and he resolved it by properly installing Python. I believe Python is properly installed on my workstation so I don't think that is creating the issue. Thanks, dennis
_______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32