print all workbooks in a folder

Microsoft Excel 2000
September 1, 2010 at 01:25:40
Specs: Windows XP, 1 gb
hi all

i have a folder named 'main' in which there are 50 odd workbooks each have 1 worksheet. can there be a macro/module through which i can print all the workbooks in that folder by a single click.

all the workbook page setup is identical.


See More: print all workbooks in a folder

Report •

September 3, 2010 at 07:39:11
This is totally the wrong forum. You're lucky I saw this at all.

Save the following as a .VBS, move the .VBS into this "main" folder, and run it.

Set fso = CreateObject("Scripting.FileSystemObject")
Set excel = CreateObject("Excel.Application")
excel.Visible = True
excel.DisplayAlerts = False

For Each f In fso.GetFolder(".").Files
  If LCase(fso.GetExtensionName(f)) = "xls" Then
    excel.Workbooks.Open f, , True
    With excel.Workbooks(fso.GetFileName(f))
      .Close False
    End With
  End If
Next 'f

Report •

September 3, 2010 at 12:18:14
thx razor

Report •

Related Solutions

Ask Question