ferguds Posted January 11, 2006 Share Posted January 11, 2006 Hi There, I searched the forums, but I'm not having luck finding a solution to my problem... I'm trying to get AutoIt to open an Excel file & alter the permissions of various worksheets. I've messed around with ExcelCom.au3 for a while before realising this requires WinXP & Office2003. But I'm running Win2K with Office2002. Does anyone think this'll be possible to do, or should I take another route? I originally had this written in Excel VB, but because there's no way to code VB for the way you Select Locked/Unlocked cells, I though Autoit might do the job. Thanks, Fergus. Link to comment Share on other sites More sharing options...
JSThePatriot Posted January 11, 2006 Share Posted January 11, 2006 Hi There,I searched the forums, but I'm not having luck finding a solution to my problem...I'm trying to get AutoIt to open an Excel file & alter the permissions of various worksheets.I've messed around with ExcelCom.au3 for a while before realising this requires WinXP & Office2003.But I'm running Win2K with Office2002.Does anyone think this'll be possible to do, or should I take another route?I originally had this written in Excel VB, but because there's no way to code VB for the way you Select Locked/Unlocked cells, I though Autoit might do the job.Thanks,Fergus.I havent used the ExcelCom.au3, or really any COM objects in AutoIt, but what I would recommend that you do is check MSDN for the objects in Office2k2. The reason the file may only work with the newer versions is because they are using some new functionality. There may be some of the ExcelCom.au3 that you will have to edit to get it working properly with your system.Just my thoughts,JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
seandisanti Posted January 11, 2006 Share Posted January 11, 2006 Hi There,I searched the forums, but I'm not having luck finding a solution to my problem...I'm trying to get AutoIt to open an Excel file & alter the permissions of various worksheets.I've messed around with ExcelCom.au3 for a while before realising this requires WinXP & Office2003.But I'm running Win2K with Office2002.Does anyone think this'll be possible to do, or should I take another route?I originally had this written in Excel VB, but because there's no way to code VB for the way you Select Locked/Unlocked cells, I though Autoit might do the job.Thanks,Fergus.most of the functions etc should be about the same from 2002-2003, i'll take a look at the UDF and see if i can't spot the change that needs to be made Link to comment Share on other sites More sharing options...
randallc Posted January 15, 2006 Share Posted January 15, 2006 Hi There,I searched the forums, but I'm not having luck finding a solution to my problem...I'm trying to get AutoIt to open an Excel file & alter the permissions of various worksheets.I've messed around with ExcelCom.au3 for a while before realising this requires WinXP & Office2003.But I'm running Win2K with Office2002.Does anyone think this'll be possible to do, or should I take another route?I originally had this written in Excel VB, but because there's no way to code VB for the way you Select Locked/Unlocked cells, I though Autoit might do the job.Thanks,Fergus.Hi,How have you been altering the "permissions" manually?Do you need to open the sheets to do that?If you can tell me more, I can possibly adjust Excel.com, but I'm not sure; you may only be talking about windows file permissions, nothing to do with Excel>????Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
ferguds Posted January 15, 2006 Author Share Posted January 15, 2006 Hi,How have you been altering the "permissions" manually?Do you need to open the sheets to do that?If you can tell me more, I can possibly adjust Excel.com, but I'm not sure; you may only be talking about windows file permissions, nothing to do with Excel>????Best, RandallHi Randall,Looking back on my post, I realise I used a wrong phrase! I should have said "protection" instead of permissions, sorry for making this confusing!!When you set protection on a worksheet, you can protect all different aspects of the worksheet. Excel presents you with a lot of checkboxs. The first two are my problem;Select Locked CellsSelect Unlocked CellsAfter I wrote some Excel VB I found there was no way to individually seperate these two options in VB, but you can do it manually (with the mouse/keyboard) alright. After doing a bit of reading on the web I found it's a known Excel weakness & there's no VB workaround to it...so in steps AutoIt!And yes, I need to open the worksheets to set individual protections to them.Thanks,Fergus. Link to comment Share on other sites More sharing options...
randallc Posted January 15, 2006 Share Posted January 15, 2006 Hi,Do you mean Excel VBA?I can record a macro showing 2 different ways of selecting;ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _ , AllowFormattingCells:=True ActiveSheet.EnableSelection = xlNoRestrictions ActiveSheet.Unprotect ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True ActiveSheet.EnableSelection = xlUnlockedCells ActiveSheet.UnprotectThat could be converted to AutoIT in Excel com or otherwise if you wished, or you could use AutoIT to run your macro?Let me know what you need....Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW 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