hazed Posted November 16, 2007 Share Posted November 16, 2007 I need to update a shared Spreadsheet. Unfortunately other's may have it opened already. Using Excelcom.au3 I open, update and get out. But sometimes when i open it it is in a readonly mode, if it is i need to do something else. Is there a easy way to find out at or shortly after opening a spreadsheat with excom.au3 if one has Read/Write access.? Link to comment Share on other sites More sharing options...
DW1 Posted November 16, 2007 Share Posted November 16, 2007 $att = FileGetAttrib( "C:\test.txt" ) If StringInStr( $att, "R" ) Then MsgBox(0, "Test", "File is read only" ) Maybe I misunderstood your question. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted November 20, 2007 Moderators Share Posted November 20, 2007 (edited) Try this...#include <ExcelCOM_UDF.au3> $sFilePath = @ScriptDir & "\Test.xls" $oWorkbook = _ExcelBookOpen($sFilePath) If $oWorkbook.ReadOnly Then MsgBox(0, "", "Your workbook is in read only mode.") EndIfExcelCOM_UDF.au3 Edited November 20, 2007 by big_daddy Added link for library Link to comment Share on other sites More sharing options...
alsolh Posted February 1, 2008 Share Posted February 1, 2008 Try this... #include <ExcelCOM_UDF.au3> $sFilePath = @ScriptDir & "\Test.xls" $oWorkbook = _ExcelBookOpen($sFilePath) If $oWorkbook.ReadOnly Then MsgBox(0, "", "Your workbook is in read only mode.") EndIfoÝ÷ Úêå Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now