Sign in to follow this  
Followers 0
ferguds

Open an Excel file

6 posts in this topic

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.

Share this post


Link to post
Share on other sites



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)

Share this post


Link to post
Share on other sites

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

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Hi 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 Cells

Select Unlocked Cells

After 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.

Share this post


Link to post
Share on other sites

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.Unprotect

That 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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0