Results 1 to 3 of 3

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

Threaded View

  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):
    Sub OpenFile_bbbPasswordIsABC_DOT_xlsm()
    
      Dim sFileName As String
      Dim sFileNamePassword As String
      Dim sPath As String
      Dim sPathAndFileName As String  
    
      sPath = ThisWorkbook.Path & "\"
      sFileName = "bbbPasswordIsABC.xlsm"
      sPathAndFileName = sPath & sFileName
      sFileNamePassword = "ABC"
    
      Workbooks.Open Filename:=sPathAndFileName, Password:=sFileNamePassword, ReadOnly:=True
    End Sub

    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

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