View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rollin_Again[_16_] Rollin_Again[_16_] is offline
external usenet poster
 
Posts: 1
Default Macro to Print All Files in a Folder

You need to open each of the workbooks in the loop before trying t
print them out.


PATHONLYSOURCE = \"C:\TEST\"
CHDIR PATHONLYSOURCE
THEFILE = DIR(PATHONLYSOURCE & \"\*.XLS\")
DO WHILE THEFILE < \"\"
WORKBOOKS.OPEN FILENAME:=PATHONLYSOURCE & \"\\" & THEFILE
ACTIVESHEET.PRINTOUT
WORKBOOKS(THEFILE).CLOSE
THEFILE = DIR
LOOP



Rolli

--
Message posted from http://www.ExcelForum.com