+ Reply to Thread
Results 1 to 3 of 3

WorkbookOpen() in Excel 2003 on Password Protected .xlsm file

  1. #1
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    WorkbookOpen() in Excel 2003 on Password Protected .xlsm file

    Hi,

    I am attempting to open a password protected .xlsm file using WorkbookOpen() in Excel 2003. Even though the password is in the WorkbookOpen() command, I am prompted to enter the password.

    Data Files with passwords are all set using Tools > Options > Security > Password to Open
    The password for the two password protected files is ABC.

    Code excerpt that compiles and runs (but asks for Password):
    Please Login or Register  to view this content.

    Am I doing something wrong, or is this a feature of the Microsoft .xlsm to .xls converter?

    The attached .zip file contains a sample workbook and 4 sample data files:
    1. OpenXlsmPasswordProtectedFileFromExcel2003.xls
    2. xxx.xls
    3. yyy.xlsm
    4. aaaPasswordIsABC.xls
    5. bbbPasswordIsABC.xlsm

    Lewis

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: WorkbookOpen() in Excel 2003 on Password Protected .xlsm file


    Hi,

    same issue : must be the converter involved …

  3. #3
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: WorkbookOpen() in Excel 2003 on Password Protected .xlsm file

    Thanks for the reply Marc.

    I have two workarounds for the problem.

    One uses SendKeys , which will probably work in XP and Vista. It may work in Windows 7, possibly requiring UAC (User Account Control) to be turned off in Windows 7, which is NOT RECOMMENDED.

    The other workaround uses keybd_event() Api. I have a keybd_event() Sub that emulates a small subset of SendKeys. This works in 32 bit Vista for me. It has not been tested on other Windows Versions.

    The attached .zip file contains a sample Excel file which implements the workarounds, and a .xlsm data file. Both should be placed in the same folder.

    Lewis

    Code follows:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Password protecting .xlsm workbook created in Excel 2003
    By LJMetzger in forum Excel General
    Replies: 3
    Last Post: 09-13-2014, 07:50 PM
  2. Replies: 1
    Last Post: 01-16-2013, 02:02 AM
  3. Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  4. Replies: 0
    Last Post: 09-06-2005, 04:05 AM
  5. Replies: 0
    Last Post: 09-05-2005, 11:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1