View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sam Wilson Sam Wilson is offline
external usenet poster
 
Posts: 523
Default Getting info from closed Excel files

Hi,

You have to have the sheet open to get the data from it. The following is as
seamless a way as I can think of to leave the user unaware of this:

Sub test()

Application.ScreenUpdating = False
Application.DisplayAlerts = False

Dim wb As Workbook
Set wb = Workbooks.Open("C:\path\test.xls")

Range("A1").Value = wb.Worksheets("MySheetName").Range("C5").Value

wb.Close

Application.DisplayAlerts = True

End Sub

"Steve" wrote:

Hi,

I have a number of excel files that my sales team use for forecasting and it
would be great to have a single file where I could pull in all the
information to.

All the forecast sheets are the same so I know the cells that I want to pull
in and I would even know the names.

I'm using Office 2007 with Vista.

Your help or guidance would be appreciated.

Thanks

Steve