#import "C:\Program Files\Common Files\Microsoft Shared\OFFICE12\mso.dll" rename("RGB", "MSRGB") #import "C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB" raw_interfaces_only, rename("Reference", "ignorethis"), rename("VBE", "testVBE") #import "C:\Program Files\Microsoft Office\OFFICE12\MSPRJ.OLB" auto_search exclude("IFont", "IPicture") rename("RGB", "ignorethis"), rename("DialogBox", "ignorethis"), rename("VBE", "testVBE"), rename("ReplaceText", "EReplaceText"), rename("CopyFile","ECopyFile"), rename("FindText", "EFindText"), rename("NoPrompt", "ENoPrompt") //Here is the code to automate Project: MSProject::_MSProjectPtr app(__uuidof(MSProject::Application)); //project opens when this line is called if it wasn't open already MSProject::_IProjectDocPtr project; MSProject::TasksPtr tasks; MSProject::TaskPtr task; app->PutVisible(-1); //prj is already visible, but if I set this to 0, it hides, it so I am successfully talking to prj project = app->GetActiveProject(); //project is nonzero after this call long x = project->GetNumberOfTasks(); //this returns 3 which is correct!! tasks = project->GetTasks(); //tasks is nonzero after this call x = tasks->Count; //exception is thrown here. I have also tried tasks->GetCount() and tasks->get_Count(&x) All of which result in the same error //Also, this produces an error as well: //task = tasks->GetItem(0); //Error: Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call
|autoit - check if option is checked in another program||2||111|
|Making an alias||7||82|
|This code tracks birthdays||3||62|
|Tax Considerations for positive outcomes, outside the U.S. for IT Professionals||3||36|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
21 Experts available now in Live!