Sign in to follow this  
Followers 0
Dazzler

_excelbookopen passing the password

5 posts in this topic

People,

I have an excel spreadsheet (2003). It is password protected for modify. I have achieved this by Tools->Options, Security tab, putting a password in 'Password to modify'. Save the sheet.

When the sheet is re-opened, you are prompted for a password. This is ok.

The problem is with: _excelbookopen

I pass the password in the function but the prompt for password still opens. I need the sheet to open without the prompt.

$excel = _excelbookopen($full_path, 1, false, "", "password")

What am I doing wrong?

Share this post


Link to post
Share on other sites



Just guessing here, but to start I would try (in case opening the file sees Read before Write):

$excel = _excelbookopen($full_path, 1, false, "password", "password")

What version of Excel btw


[font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font]

Share this post


Link to post
Share on other sites

$oEx = _ExcelBookOpen(@ScriptDir & "\test.xls", 1, False, "", "password2")

This works fine for me (XP SP3 + Excel 2003)


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

AHA!

As yours worked, something is wrong with mine. Its an .xlsx. So there is conversion going on as you open and close; and this is clearly undermining the _excelbookopen. I resaved as .xls and it works a treat.

Thank you people.

Share this post


Link to post
Share on other sites

Glad I could help you to find the solution, though I wouldn't have guessed this solution. :mellow:


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

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