Roger Upole wrote:
Ron Henderson wrote:
My guess is that it *is* a Python problem somewhere in the win32com bindings, based on the fact that executing a macro seems to do the right thing but going directly through the com API from Python does not.

The macro executes essentially the same functionality:

Sub my_export()
    FileSaveAs name:="...", formatId:="MSProject.CSV", map:="My Map"
End Sub


Have you tried using exactly the same parameters in your Python code?
It's using Format=3 instead of FormatId.

If that doesn't get it, it may have something to do with the default
values for arguments that you're not passing.

This works for me (I basically recorded a Macro and reproduced it):

<code>
import win32com.client

project = win32com.client.Dispatch ("MSProject.Application")
project.FileOpen ("c:/temp/p1.mpp")
project.FileSaveAs (Name="c:/temp/p2.csv", FormatID="MSProject.CSV", Map="p1")
project.FileClose (Save=0)
project.FileQuit ()

</code>

TJG
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to