The problem seems to be that pgb is not valid. This happens when the active page is not a graph page. I guess yesterday you ran the function when a graph page is activated but today, the active page is not a graph. Please check.
I suggest that the first few lines should be changed to:
PageBase pgb;
pgb = Project.Pages(); // Get the project's active page
if( pgb.IsValid() )
printf("Active page is of type %d\n", pgb.GetType());
else
{
printf("Active page is invalid\n");
return; //Return immediately
}
Then if pgb is not valid, the function will return immediately, without executing the rest part of the function.
Deanna
OriginLab GZ Office
Edited by - Deanna on 09/11/2006 01:28:16 AM