"The method is not available in this situation" in filesavas method

M

mikimik

I have an windows application that save
it to local harddisk using the ApplicationClass.FileSaveAs method in
XML format.

.. However, when I deploy the app and let it
run by itself, the FileSaveAs method throws exception :

Exception: System.Runtime.InteropServices.COMException
Message: The method is not available in this situation.
Source: Microsoft Project
at System.RuntimeType.ForwardCallToInvokeMember(String memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at Microsoft.Office.Interop.MSProject.ApplicationClass.FileSaveAs

the code is:
projectApp.FileSaveAs(filepath, PjFileFormat.pjMPP, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, "MSProject.XML", Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value);

Anybody has any hint?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top