Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Opening 4 files with 1 button?

Hi,

I have a boss who needs to open 4 files each week to print.
Is there a way I can give him an Excel page with a button on it which Prints
these 4 files?

Any help would be appreciated!!

Regards,
Rusty


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Opening 4 files with 1 button?

Rusty

You could use a Workspace to open all four files at once. See under the
File menu - Save As Workspace.

If you want a macro that opens, prints, and closes the files, it might look
like this

Sub Open4Files()

Dim aFnames As Variant
Dim sPath As String
Dim i As Long
Dim wb As Workbook

aFnames = Array("File1.xls", "file2.xls", "file3.xls", "file4.xls")
sPath = "C:\MyFolder\"

For i = LBound(aFnames) To UBound(aFnames)
Set wb = Workbooks.Open(sPath & aFnames(i))
wb.Windows(1).SelectedSheets.PrintOut
wb.Close savechanges:=False
Next i

End Sub

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

RustyR wrote:
Hi,

I have a boss who needs to open 4 files each week to print.
Is there a way I can give him an Excel page with a button on it which
Prints these 4 files?

Any help would be appreciated!!

Regards,
Rusty



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Opening 4 files with 1 button?

Hi RustyR

Try this if the files are closed (There is no error check)
It will print 4 files in the C:\Data\ folder

Sub test()
Dim wbname As Variant
Dim N As Integer
Dim wb As Workbook
wbname = Array("test1.xls", "test2.xls", "test3.xls", "test4.xls")
For N = LBound(wbname) To UBound(wbname)
Set wb = Workbooks.Open("C:\Data\" & wbname(N))
wb.PrintOut
wb.Close False
Next
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"RustyR" wrote in message ...
Hi,

I have a boss who needs to open 4 files each week to print.
Is there a way I can give him an Excel page with a button on it which Prints
these 4 files?

Any help would be appreciated!!

Regards,
Rusty




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
show most recent files first when opening excel files Anne` Excel Discussion (Misc queries) 5 January 23rd 08 01:54 AM
opening a worksheet with a command button on a form gbpg Excel Discussion (Misc queries) 2 September 1st 07 05:40 AM
Opening Quattro Pro for Windows files (*.WB1 Files) using Excel 20 PoundMutt Excel Discussion (Misc queries) 1 June 20th 07 03:50 AM
How can I view files chronologically when opening multiple files Stevilsize Excel Discussion (Misc queries) 3 July 26th 05 12:49 AM
Opening a worksheet with a button? joe Excel Programming 1 July 16th 03 04:47 PM


All times are GMT +1. The time now is 05:24 PM.

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

About Us

"It's about Microsoft Excel"