Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
worksheet saveas workbook Nigel Excel Programming 2 August 11th 05 05:40 PM
Using custom template with Excel.Workbook.SaveAs [email protected] Excel Programming 1 January 28th 05 04:16 AM
workbook saveas function, xlText file format Massimo Bassini[_2_] Excel Programming 3 January 26th 05 04:05 PM
Canceling SaveAs dialog box without saving workbook CDotWin Excel Programming 3 July 24th 04 01:09 AM
Workbook.SaveAs Paul Excel Programming 2 August 25th 03 08:12 PM


All times are GMT +1. The time now is 09:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"