Friday, November 25, 2011

Re: com_error

On Nov 24, 2011, at 8:31 AM, Virginia wrote:

> I forgot to mention that Microsoft office is not install on the
> server. Is it a problem?
>
> Regard,
>
> V.B.

Yes. Your code is using Excel to read/write the file. Obviously that won't work if it's not there. http://www.python-excel.org/ says it work, but I haven't tried it.

In general, I try not to use COM for anything. It hasn't been well supported since 2004, and there are too many "legacy design decisions".

> On 24 nov, 09:58, Phanounou <virginia.bel...@gmail.com> wrote:
>> Good day everyone,
>>
>> I am trying to create/edit and close an excel file. Everything went fine on
>> my developpement machine. But on the prod server I get the* following error*
>> :
>>
>> com_error at /mycontracts/getContactClient/
>> (-2147221005, 'Invalid class string', None, None)
>>
>> *and this trace back*
>>
>> Environment:
>>
>> Request Method: GET
>> Request URL:http://myserveraddress/contractManager/mycontracts/getContactClient/
>> Django Version: 1.3
>> Python Version: 2.7.2
>> Installed Applications:
>> ['django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.sites',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> 'django.contrib.admin',
>> 'mycontracts',
>> 'django.contrib.admindocs']
>> Installed Middleware:
>> ('django.middleware.common.CommonMiddleware',
>> 'django.contrib.sessions.middleware.SessionMiddleware',
>> 'django.middleware.csrf.CsrfViewMiddleware',
>> 'django.contrib.auth.middleware.AuthenticationMiddleware',
>> 'django.contrib.messages.middleware.MessageMiddleware',
>> 'django.middleware.csrf.CsrfResponseMiddleware')
>>
>> Traceback:
>> File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in
>> get_response
>> 111. response = callback(request, *callback_args,
>> **callback_kwargs)
>> File "C:\Python27\lib\site-packages\django\contrib\auth\decorators.py" in
>> _wrapped_view
>> 23. return view_func(request, *args, **kwargs)
>> File "C:\APP\contractManager\mycontracts\views.py" in getContactClient
>> 759. myresultForExcelFile =
>> createMatriceContactClientExcelFileNotFromRequest(clients)
>> File "C:\APP\contractManager\mycontracts\views.py" in
>> createMatriceContactClientExcelFileNotFromRequest
>> 1016. excel = Dispatch('Excel.Application')
>> File "C:\Python27\lib\site-packages\win32com\client\__init__.py" in Dispatch
>> 95. dispatch, userName =
>> dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
>> File "C:\Python27\lib\site-packages\win32com\client\dynamic.py" in
>> _GetGoodDispatchAndUserName
>> 108. return (_GetGoodDispatch(IDispatch, clsctx), userName)
>> File "C:\Python27\lib\site-packages\win32com\client\dynamic.py" in
>> _GetGoodDispatch
>> 85. IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
>> pythoncom.IID_IDispatch)
>> Exception Type: com_error at /mycontracts/getContactClient/
>> Exception Value: (-2147221005, 'Invalid class string', None, None)
>>
>> Can you please help me see what is wrong. It's the same code on my machine
>> and on the server.
>>
>> Regards,
>> V.B.
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>

Peter of the Norse
RahmCoff@Radio1190.org

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment