>>This document has been modified. Do you want to save changes? >> >> Yes: Saves your changes >> No: Discards your changes >> Cancel: Keeps this document open >>>>
lcXLSFile = Getfile('xls') >>> >>>#Define xlNoRestrictions 0 >>>#Define xlUnlockedCells 1 >>>#Define xlNoSelection -4142 >>> >>>Public oForm >>>oForm = Createobject('myExcelForm',m.lcXLSFile) >>>oForm.Show() >>> >>>Define Class myExcelForm As Form >>> Top = 0 >>> Left = 0 >>> Height = 450 >>> Width = 750 >>> Caption = "HTML Excel sample" >>> >>> Add Object htmlviewer As OleControl With ; >>> top = 0, ; >>> left = 0, ; >>> height = 450, ; >>> width = 750, ; >>> anchor= 15, ; >>> visible = .T., ; >>> name = "HTMLViewer", ; >>> oleclass = 'Shell.Explorer' >>> >>> Procedure Init >>> Lparameters tcXLSFile >>> With Thisform.htmlviewer >>> .Navigate2('file://'+m.tcXLSFile) >>> Do While .ReadyState # 4 && Wait for ready state >>> Enddo >>> oXLS = .Object.Document >>> oExcel = oXLS.Application >>> oExcel.CommandBars("Standard").Visible = .F. >>> oExcel.CommandBars("Formatting").Visible = .F. >>> oExcel.ActiveWorkbook.ActiveSheet.EnableSelection = xlNoSelection >>> oExcel.ActiveWorkbook.ActiveSheet.Protect(,,.T.,,.T.) >>> Endwith >>> Endproc >>>Enddefine >>>Cetin
oExcel.DisplayAlerts = .f. >oExcel.ActiveWorkbook.Saved = .t.Cetin