Title: WINCOM EXCEL protect cells Post by: Malabad P. on June 15, 2017, 05:20:06 pm Has anyone tried to lock excel data cells?
I am trying to lock a range of cells from editing. VBA has Worksheet("Sheet1").Range("A1:E10").Locked = true I am assuming this is a setProperty and not CallMethod but I keep getting the DISPID_UNKNOWN error. define waddr,wcell,wvalue string, wres,wlin integer # wcell = 'A1:E11' I tried LET waddr = 'activeworksheet.Range("',wcell clipped,'").Locked' as well as LET waddr = 'activeworksheet.Range("',wcell clipped,'").Cells.Locked' with call ui.Interface.FrontCall("WinCOM","SetProperty",[xlwb,waddr,"True"],[wres]) and I get COMM Error gor call at line 600 One or more of the names were not known. The returned array of DISPIDs contains DISPID_UNKNOWN for each entry that corresponds to an unknown name. Exit with COM Error. I also tried LET waddr = 'activeworksheet.Range("',wcell clipped,'").Locked = True' as well as LET waddr = 'activeworksheet.Range("',wcell clipped,'").Cells.Locked = True' with call ui.Interface.FrontCall("WinCOM","SetProperty",[xlwb,waddr],[wres]) and I get Program stopped at 'hb_setup.4gl', line number 105. FORMS statement error number -6334. Front end function call stack problem. Which tells me I was closer the first way. Thanks for any guidance. Also, Is there a list of WINCOM properties either through 4js or Microsoft? Paul |