Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I use VC++6.0 to protect a excel file to readonly


I use VC++6.0 to create a temp excel file, and I don't want other use
to modify it, I use _Workbook.ChangeFileAccess to set readonly, but i
cannot help, a exception throw out, the message is "cannot fin
member", when I invoke ChageFileAccess function, the code is lik
this:

COleVariant vtOptional((long)DISP_E_PARAMNOTFOUND,
VT_ERROR),vtTrue((short)TRUE),vtFalse((short)FALSE );
_Application *ExcelApp = new _Application;

ExcelApp-CreateDispatch("excel.application");



//ÉèÖÃΪÏÔʾ
ExcelApp-SetVisible(TRUE);
//µÃµ½WorkBooks
Workbooks ExcelBook=ExcelApp-GetWorkbooks();



Sheets ExcelSheet=ExcelBook.Add(vtOptional);
_Workbook workBook;
_Worksheet workSheet;
Range range;
workBook.AttachDispatch(ExcelApp-GetApplication());

ExcelSheet=workBook.GetSheets();

////////////////////////////////////////////
workSheet=ExcelSheet.GetItem(COleVariant((short)1) );
workSheet.Activate();

can anyone help me? Thanks

--
gowinderPosted via http://www.officehelp.in - <a href="http://www.officehelp.in">Microsoft Office Software</a&gt

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I use VC++6.0 to protect a excel file to readonly


Please help me

--
gowinderPosted via http://www.officehelp.in - <a href="http://www.officehelp.in">Microsoft Office Software</a&gt

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I use VC++6.0 to protect a excel file to readonly


can anyone help me please

--
gowinderPosted from - http://www.officehelp.i

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
Excel thinks a file is ReadOnly but it is not. How to fix? Don Berman Excel Discussion (Misc queries) 1 March 27th 08 05:42 PM
Changing file from readonly Niall Excel Discussion (Misc queries) 2 July 27th 06 04:58 PM
How do I use VC++6.0 to protect a excel file to readonly gowinder Excel Worksheet Functions 1 September 22nd 05 02:16 AM
Closing ReadOnly file using VBA acces Excel Programming 1 January 15th 04 08:59 PM
Opening a ReadOnly file in Excel VBA Demon Excel Programming 4 August 8th 03 04:06 AM


All times are GMT +1. The time now is 04:10 AM.

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

About Us

"It's about Microsoft Excel"