Unable to save project project

Add-in Express™ Support Service
That's what is more important than anything else

Unable to save project project
 
Omri Suissa


Guest


Hi,
I'm trying to save the current project like that:

object objForNothing = new object();
MSProjectApp.ActiveProject.SaveAs("c:.mpp", MSProject.PjFileFormat.pjMPP, objForNothing, objForNothing, objForNothing, objForNothing, objForNothing, objForNothing, objForNothing, objForNothing, objForNothing, objForNothing, objForNothing, objForNothing, objForNothing);

But i'm keep getting "The argument value is not valid." (error 1101).
What i'm doing wrong? there is a value that must be supplied?

Thanks,
Omri
Posted 29 Nov, 2011 08:37:55 Top
Eugene Astafiev


Guest


Hi Omri,

First of all, please note that you don't release underlying COM objects properly in the code. You can read more about this in the http://www.add-in-express.com/creating-addins-blog/2008/10/30/releasing-office-objects-net/ article. Also please take a look at the http://www.add-in-express.com/creating-addins-blog/2006/08/17/outlook-not-closing/ article on our technical blog.

Did you try to specify Type.Missing or just omit optional parameters instead of using the objForNothing in the code?
Posted 29 Nov, 2011 08:54:02 Top
Omri Suissa


Guest


Thanks,
Type.Missing was my problem.
about the com release, this is just an example, but thanks :)
Posted 29 Nov, 2011 09:47:36 Top