Run method wont work

R

Robert

Im trying to use the run method to run a macro in MS
Project who has two arguments. But the damn thing wont
work!! I get "An unexpected error occurred with the
method".

My code (c++):

_MSProject pMspApp; // 'Application' object
_variant_t vFileSystemPK, vDbPath, vNull;

vNull.vt = VT_NULL;

vFileSystemPK = 1;
vDbPath.SetString("c:\\test.mdb");

pMspApp.CreateDispatch("MSProject.Application");

pMspApp.Run("MyMacro", vFileSystemPK, vDbPath, vNull,
vNull, vNull, vNull, vNull, vNull, vNull, vNull, vNull,
vNull, vNull, vNull, vNull, vNull, vNull, vNull, vNull,
vNull, vNull, vNull, vNull, vNull, vNull, vNull, vNull,
vNull, vNull, vNull);


If i put a ! before the macro name (pMspApp.Run("!
MyMacro", etc....) i dont get the error message but it
still doesent work.
Anyone knows whats wrong???
 

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