Results 1 to 7 of 7

Open all files in a folder using list of password

Threaded View

smiledt06 Open all files in a folder... 06-12-2021, 02:51 AM
Marc L Re: Open all files in a... 06-12-2021, 11:01 AM
smiledt06 Re: Open all files in a... 06-12-2021, 08:16 PM
Marc L Try this ! 06-12-2021, 11:01 PM
smiledt06 Re: Open all files in a... 06-17-2021, 01:04 PM
Marc L Re: Open all files in a... 06-17-2021, 02:54 PM
smiledt06 Re: Open all files in a... 06-17-2021, 07:36 PM
  1. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this !


    • As yet stated according to your 'File structure' list only 2 files can be treated so you must first correct this list

    • On my side the Dir VBA function can not work 'cause of the asian characters in some files names so according to your attachment :

    PHP Code: 
    Sub Demo1()
            
    Dim PF$, oF As ObjectV
        With Sheet1
                P 
    = .[TRANSPOSE(B2:B3&IF(RIGHT(B2:B3,1)<>"\","\",""))]
            With .Range("
    A8", .[B7].End(xlDown)).Columns
                F = "
    TRANSPOSE(IF(ISNUMBER(MATCH(" & .Item(1).Address(, , , True) & ",{""#""},0))," & .Item(2).Address(, , , True) & "))"
            
    End With
        End With
        With CreateObject
    ("Scripting.FileSystemObject")
            If .
    FolderExists(P(1)) And .FolderExists(P(2)) Then
                    Application
    .DisplayAlerts False:  Application.ScreenUpdating False
                
    For Each oF In .GetFolder(P(1)).Files
                        V 
    Filter(Evaluate(Replace(F"#"oF.Name)), FalseFalse)
                    If 
    UBound(V) = 0 Then
                        With Workbooks
    .Open(oF.Path, , , , V(0))
                            .
    SaveAs P(2) & Left(oF.NameInStrRev(oF.Name".")) & "xlsx"51, Empty
                            .
    Close
                        End With
                    End 
    If
                
    Next
                    Application
    .DisplayAlerts True:  Application.ScreenUpdating True
            
    Else
                
    Beep
            End 
    If
        
    End With
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !
    Last edited by Marc L; 06-13-2021 at 06:57 AM. Reason: tiny optimization …

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA to open the list of excel files and save with password
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2020, 02:38 AM
  2. [SOLVED] Macro to list and open .xlsm files in folder and sub-folder
    By Howardc1001 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-24-2019, 07:35 PM
  3. [SOLVED] open list of all .csv files in a folder and copy few colums in a excel of same sheet.
    By gnrao80 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-04-2014, 01:19 AM
  4. [SOLVED] Open password protected files in folder using list of passwords
    By Shift-4 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-22-2013, 06:08 PM
  5. [SOLVED] Password array to open all password protected workbook in a folder
    By rename in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-07-2012, 05:06 AM
  6. [SOLVED] Open all files in a SharePoint folder (Problem: Files open out of order)
    By holmstarrunner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2012, 10:13 AM
  7. Replies: 2
    Last Post: 04-15-2005, 12:06 PM

Tags for this Thread

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