nasar 0 Posted March 13, 2013 (edited) Hi, I have a small application that uses an excel file to store data. At this point my excel file does not have a password but I would like to set one and I am bit lost - so that users do not have access to open the file other than through my application (I am okay to hardcode the password). Since im using the following code to open and write to the file - appreciate your help with this - excuse the terrible programming skills and borrowed code... Also at no point do i want the users to see the excel file opening and all that - ideally if all of this can be done without the users seeing the fiel opening and all that it would be great - I was trying to avoid using the SEND fucntion. GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $SaveButton GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing anything $FileName=@ScriptDir & "\Worksheet1.xls" if not FileExists($FileName) then ; Just a check to be sure.. Msgbox (0,"Excel Data Test","Error: Can't find file " & $FileName) Exit endif $oExcelDoc = ObjGet($FileName) ; Get an Excel Object from an existing filename If (not @error) and IsObj($oExcelDoc) then ; Check again if everything went well $iRowCount = $oExcelDoc.ActiveSheet.UsedRange.Rows.Count $iRowCount = $iRowCount + 1 $oExcelDoc.saved=1 ; Prevent questions from excel to save the file $oExcelDoc.close EndIf WEnd Edited March 13, 2013 by nasar Share this post Link to post Share on other sites