[RESOLVED] protect work sheet structure
with vb.net + excel 2002
i am transferring data in to an new excel instance
(1) how can i stop users form copy the contents of the work sheet
answer is alm0st uncertain
hence i want to protect the structure of my work sheet (book)
if i protect the work sheet tools -> security ->xx...
then the locked cells are not getting selected for copy purpose, where as how to do the same with vb.net .
i mean an equivalent of VBA
Re: protect work sheet structure
Record a macro in Excel and amend it for vb.net.... ;)
Re: protect work sheet structure
ia very cool
xlSheet.EnableSelection = -4142
thank you
Re: [RESOLVED] protect work sheet structure
cool sid
i am having one more issue please
i want to apply the "Enableselection property of worksheet "
to be applied for only the locked cells
not to the columns, i must be able to enable column sizing + row sizing
is it possible
i tried this way but failed !
Code:
eXlWs.Cells.Locked = False
eXlWs.Range("A5:m10").Cells.Locked = True
eXlWs.Columns.AutoFit()
eXlWs.Protect("123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1, 1, 1, 1, 1, 1, 1)
eXlWs.EnableSelection = _ Excel.XlEnableSelection.xlNoSelection
ExlWb.Protect("123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")
ExlAPp.CutCopyMode = False
ExlAPp.Visible = True
ExlAPp = Nothing
ExlWb = Nothing
eXlWs = Nothing
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
sorry cool sid
i got the solution for my problem