Re: Issue with PythonCOM - Application.Run does not work for Access.Application
Tim Roberts <[email protected]>
| Newsgroups | gmane.comp.python.windows |
|---|---|
| Organization | Providenza & Boekelheide, Inc. |
| Message-ID | <[email protected]> |
Christoph J. Dorner wrote:
>
> I need to call Office / VBA applications form a running Python script.
> While calling VBA from Python using Application.Run works with EXCEL, it
> does not work with ACCESS. What I do:
> I link to the Office application via the win32com.client dispatch
> mechanism as usual and I can see the application object in the Python
> debugger.
> If I do an excelapp.Run('xxx") everything is fine.
> If I do an accessapp.Run('xxx") it throws an error -2147352562 which
> win32api.FormatMessage states is an issue with the number of parameters.
> But that cannot be the case as the UDF has no parameter and I do not
> pass any (additional) parameter.
Curious. Both the Excel "Application.Run" and Access "Application.Run"
methods are defined the same way, with 30 "optional" parameters. Have
you experimented with specifying a dummy parameter to see if that makes
a difference?
Have you tried using "win32com.client.gencache.EnsureDispatch" instead
of simple "Dispatch"? That way, it generates and caches a wrapper
file. It might be possible to peek in the generated file to see if the
wrappers look any different.
--
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
_______________________________________________
python-win32 mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-win32
smime.p7s
(application/pkcs7-signature, 3.3 KB) - not displayed