If you want to save the whole project as a new name each time this should work.
CString String1;
CString String2;
int file_count=0;
String1.Format("C:\\file\\file\\basefilename");
while(keep_taking_measuremnts == true)
{
if(measurement_taken == true)
{
String2.Format("%s%d.xls",String1,file_count);
file_count++;
book.saveas(COlevariant(String2,....
measurement_taken = false;
}
//rest of code in measurement loop
}
This would give you basefilename0.xls, basefilename1.xls,basefilename2.xls etc.
Grant
Grant M. Johnson
Project Engineer
LECO Corporation