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???
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???