View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
external usenet poster
 
Posts: 1,298
Default Print Another Excel File's Worksheet

this should get you started ....



Sub FetchFile()
Dim sFileName As String
Dim wb As Workbook
sFileName = Application.GetOpenFilename("Excel Files (*.xls),*.xls")

'check if Cancelled
If UCase(sFileName) < "FALSE" Then
Set wb = Workbooks.Open(sFileName, ReadOnly:=True)

wb.ActiveSheet.PrintOut Copies:=1, Collate:=True

wb.Close False 'close without saving!

End If
End Sub


"Andy" wrote:

Hi Gang

I need code in one Excel file that will print the contents of another
Excel file worksheet. I'd like to be able to specify the folder and
file to print (ie. m:\governance\expensereport.xls).

Can anyone help?

Andy