Cant get Run function to work

A

andreas

Im trying to use the Run function to run a Macro with two
arguments in Microsoft Project. But i can t get it to
work. I get "An unexpected error occured with the method".
Heres my code:

_MSProject pMspApp;
_variant_t vFileSystemPK, vDbPath;

vPK = 11;
vDbPath.SetString("c:\\Test.mdb");

pMspApp.CreateDispatch("MSProject.Application");

_variant_t vTest;
vTest.vt = VT_ERROR;
vTest.scode = DISP_E_PARAMNOTFOUND;

pMspApp.Run(LPCTSTR("StartNewTpl"), vPK, vDbPath, vTest,
vTest, vTest, vTest, vTest, vTest, vTest, vTest, vTest,
vTest, vTest, vTest, vTest, vTest, vTest, vTest, vTest,
vTest, vTest, vTest, vTest, vTest, vTest, vTest, vTest,
vTest, vTest, vTest);
 

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

Similar Threads


Top