A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Print all .xls files in selected directory



 
 
Thread Tools Display Modes
  #1  
Old September 1st, 2004, 11:57 AM
LB79
external usenet poster
 
Posts: n/a
Default Print all .xls files in selected directory

Does anyone know of a way that i can create a macro that prints all .xls
files in a particular diretory?

Thanks


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

  #2  
Old September 1st, 2004, 12:13 PM
Jim May
external usenet poster
 
Posts: n/a
Default

Try:

Sub PrintAllinFolder()
Dim i As Long
Dim WB As Workbook
Application.ScreenUpdating = False
With Application.FileSearch
.NewSearch
.LookIn = "C:\My Documents\MyFolderName"
.SearchSubFolders = False
.FileType = msoFileTypeExcelWorkbooks
If .Execute() 0 Then
For i = 1 To .FoundFiles.Count
Set WB = Workbooks.Open(.FoundFiles(i))
WB.PrintOut
WB.Close SaveChanges:=False
Next i
End If
End With
Application.ScreenUpdating = True
End Sub


Feedback appreciated...
I use Excel - XP
Jim May


"LB79 " wrote in message
...
Does anyone know of a way that i can create a macro that prints all .xls
files in a particular diretory?

Thanks


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



  #3  
Old September 1st, 2004, 01:16 PM
LB79
external usenet poster
 
Posts: n/a
Default

This works really well! Thank you!!!


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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I print the details view David Running & Setting Up Queries 5 August 28th, 2004 12:17 AM
problems initiating mplay32.exe electricrainbowfish Powerpoint 8 July 8th, 2004 09:37 AM
Office XP Ed Lester Setup, Installing & Configuration 1 May 27th, 2004 09:30 AM
horizontal bar chart print settings messed up when all sheets selected Mary Charts and Charting 0 April 15th, 2004 07:46 PM
Filtering Worksheets To Print Only What you selected esmith Worksheet Functions 1 October 22nd, 2003 07:57 PM


All times are GMT +1. The time now is 01:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.