Dazzler Posted August 26, 2011 Share Posted August 26, 2011 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? Link to comment Share on other sites More sharing options...
shornw Posted August 26, 2011 Share Posted August 26, 2011 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] Link to comment Share on other sites More sharing options...
hannes08 Posted August 26, 2011 Share Posted August 26, 2011 $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] Link to comment Share on other sites More sharing options...
Dazzler Posted August 26, 2011 Author Share Posted August 26, 2011 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. Link to comment Share on other sites More sharing options...
hannes08 Posted August 26, 2011 Share Posted August 26, 2011 Glad I could help you to find the solution, though I wouldn't have guessed this solution. Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] 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