Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I have a SDI application developed using MFC Appwizard. This is an office automation application and MS Excel is automated in this application. In this application I have shown an excel file in right pane (client view) of the application. I want to show my excel files in right pane in protected mode such that user can only view the files can not copy and write. I protect the excel file as : oWSheet = oWBook.GetActiveSheet(); oWSheet.Protect(COleVariant(_T("password")),covTru e,covTrue,covTrue,covTrue, covOpt,covOpt,covOpt,covOpt,covOpt,covOpt,covOpt,c ovOpt, covOpt,covOpt,covOpt); oWSheet.SetEnableSelection(-4142); oWBook.SaveAs(COleVariant(_T("c:\\test.xls")),covO ptional,COleVariant(_T("") ),COleVariant(_T("")), covFalse,covFalse,1,covOptional,covFalse,covOption al, covOptional,covOptional); oWBook.Save(); //*****File is protected and can not be selected, copied******/ oWBook.Close(covOptional,covOptional,covOptional); //*****Problem occurs after this statement******/ oWBook.ReleaseDispatch(); oWBooks.Close(); oWBooks.ReleaseDispatch(); oApp.Quit(); oApp.ReleaseDispatch(); Problem occurs at this statement. oWBook.Close(covOptional,covOptional,covOptional ); As file closed its protection lost in such a way that file can not be written and can be selected and copy. I want to stop this. Before closing the file as I saw in MS Excel (visible mode) file is completely protected and can not be selected, copy and written. Reply ASAP. With Best Regards |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protect sheet unchecking "Select locked cells" has undesiredresults | Excel Discussion (Misc queries) | |||
select a range, copy it to a new sheet | Excel Discussion (Misc queries) | |||
Protect excel sheet and still copy text or object w/o unprotectin. | Excel Discussion (Misc queries) | |||
How to stop the 'select sheet' window pop up | Excel Programming | |||
Select rows and copy to another sheet. | Excel Programming |