Hi ,
After exporting a report to excel i need a column to be locked (i.e user should not be able to edit that column ).
I dont want to do it manually by going to FORMAT CELLS-->LOCK the particular cells and protect the sheet . ](*,)
Thanks,
Bhareth
0
Comments
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Lock is Boolean TRUE
It is a request from one of our customers .They want users should not be able to edit the amount field on any financial reports after exporting the reports to excel .
bbrown ,
I tried with your Lock code but after exporting the report to excel ,still i can able to edit the particular field which i have made locked .
Thanks,
Bhareth
How do you export the report to excel? firstly i thought you were using RTC reports and the standard excel functionality (in that case, i don't think it's possible to implement the column lock); if you don't use the standard function, what code do you use to export the report to excel?
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Function LockColumn(StartColumn:code;StartRow:Integer;EndColumn:Code;EndRow:Integer;Lock:Boolean);
************code starts
XlRange := XlWrkSht.Range(StartColumn+FORMAT(StartRow) + ':'+EndColumn+FORMAT(EndRow-1));
XlRange.Locked(Lock);
*********** code ends
in the report
ExcelBuf.CreateSheet(...);
LockColumn('A',2,'A',65000,'TRUE');
ExcelBuf.GiveUserControl;
I dont want the column A to be edited by anyone after exporting the report to excel.
correct me if i am wrong anywere!!!!!!! ](*,)
thanks,
bhareth
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
with protect i can able to protect the whole sheet (with a password).once the sheet is protected i am unable to edit other columns apart form the column which is locked .If there is a protect command why i need to lock particular columns??
what i need is that i want to lock particular columns(i.e make that column uneditable) and make other columns editable . ](*,)
Thanks,
bhareth