GUEdiver246
Technical User
I currently have a working file to print a single excel file with multiple tabs. I need to modify it to print multiple excel files within the single folder. My folder contains 5 excel files with .xlsx extension and a few other files that I do not want to print. The folder might end up renamed or moved. I need it to continue working if that happens. Thank you for any help you can provide.
set shApp = CreateObject("shell.application")
currentPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
set shFolder = shApp.NameSpace( currentPath )
Set oExcel = CreateObject("Excel.Application")
oExcel.Visible = False
oExcel.Workbooks.Open currentPath & " \ " & "AHT CDE Fluid Tracking.xlsx"
oExcel.Workbooks(1).Sheets.PrintOut
oExcel.Workbooks.Close
oExcel.Quit
Set shApp = Nothing
Set shFolder = Nothing
Set oExcel = Nothing
set shApp = CreateObject("shell.application")
currentPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
set shFolder = shApp.NameSpace( currentPath )
Set oExcel = CreateObject("Excel.Application")
oExcel.Visible = False
oExcel.Workbooks.Open currentPath & " \ " & "AHT CDE Fluid Tracking.xlsx"
oExcel.Workbooks(1).Sheets.PrintOut
oExcel.Workbooks.Close
oExcel.Quit
Set shApp = Nothing
Set shFolder = Nothing
Set oExcel = Nothing