Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Open all wokbooks from folder with macro

Hello everybody! I have this macro in VB, but I want open all workbooks that are in this folder, but I dont know how will be the names of all workbooks. I tried this but it doesn't work..

FUNCTION ConvertirFormatoArchivos()

  Dim  file, origen
  Set objExcel = CreateObject("Excel.Application")

  set file = CreateObject("Scripting.FileSystemObject")

         CurrentDirectory = path.GetAbsolutePathName(".")

         origen = CurrentDirectory & "\Bajadas\"  

         file  = origen & "*.xlsb"

          While (file <> "")

          

               objExcel.Workbooks.Open(file)

               file = origen & "*.xlsb" 'Tomo todos los archivos binarios de la carpeta \Bajadas

         Wend 

END FUNCTION

Thank you!!

11 Replies
Not applicable
Author

It work now!! Thank you!!

Not applicable
Author

Good question, very helpful response.