com_error

126 views
Skip to first unread message

Phanounou

unread,
Nov 24, 2011, 9:58:35 AM11/24/11
to django...@googlegroups.com
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:
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.

Virginia

unread,
Nov 24, 2011, 10:31:06 AM11/24/11
to Django users
I forgot to mention that Microsoft office is not install on the
server. Is it a problem?

Regard,

V.B.

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*

Peter of the Norse

unread,
Nov 25, 2011, 5:59:23 PM11/25/11
to django...@googlegroups.com
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".

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

Peter of the Norse
Rahm...@Radio1190.org

Reply all
Reply to author
Forward
0 new messages