Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook::SaveAs() in MFC - Please help!
Hi,
I can't find any information on how to use automation to save a file in MFC. I have the file name I need to save to. I have automation working and have my workbook created. Now all I need is the correct way to call the Workbook::SaveAs method. This is what I'm trying right now: book.SaveAs(COleVariant(outputFilename), COleVariant((long) xlWorkbookNormal), covOptional, covOptional, covFalse, covFalse, *value for write*???, covOptional, covOptional, covOptional, covOptional, covOptional); // I have tried a few values for the write value. I keep getting an Error Message Box saying: "The file could not be accessed" and a bunch of incorrect suggestions as to the cause of the problem. Please help if you can! Thanks in advance! Aruk |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook::SaveAs() in MFC - Please help!
Okay, I'm not sure what I changed, but it works now. (I think output filename
was getting wiped out after I set it, but before the function call, if so the error message was correct after all). I used CFile::modeWrite (value 0) for the access mode parameter, but other than that the call is unchanged. I hope this helps someone else. Aruk "ArukTheRed" wrote: Hi, I can't find any information on how to use automation to save a file in MFC. I have the file name I need to save to. I have automation working and have my workbook created. Now all I need is the correct way to call the Workbook::SaveAs method. This is what I'm trying right now: book.SaveAs(COleVariant(outputFilename), COleVariant((long) xlWorkbookNormal), covOptional, covOptional, covFalse, covFalse, *value for write*???, covOptional, covOptional, covOptional, covOptional, covOptional); // I have tried a few values for the write value. I keep getting an Error Message Box saying: "The file could not be accessed" and a bunch of incorrect suggestions as to the cause of the problem. Please help if you can! Thanks in advance! Aruk |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
worksheet saveas workbook | Excel Programming | |||
Using custom template with Excel.Workbook.SaveAs | Excel Programming | |||
workbook saveas function, xlText file format | Excel Programming | |||
Canceling SaveAs dialog box without saving workbook | Excel Programming | |||
Workbook.SaveAs | Excel Programming |