LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Getting info from closed Excel files

Hi

I tried the following code from John which works OK except it brings up the
open dialogue box. As sson as I select file and OK it poulates the cell in my
master file.

Can I do it without going through the "Open Dialogue" box?

Private Sub CmdGetData_Click()

Dim mydata As String

'data location & range to copy
'<< change as required
'mydata = "='C:\[Mybook.xls]Sheet1'!$B$2:$F$12"
mydata = "='C:\Users\sreed\Documents\Personal\Excel\Forecas t Test[Cadassist
Forecast.xlsm]Summary'!$B$2:$B$2"

'link to destination worksheet
'<< change as required
With ThisWorkbook.Worksheets(1).Range("B2:B2")
.Formula = mydata

'convert formula to text
.Value = .Value

End With


End Sub



"john" wrote:

Steve,
you should be able to do this using formula without the need to open the file.

try following and see if it helps. Change file name \ folder \ worksheet
name as required

Sub GetData()
Dim mydata As String

'data location & range to copy
'<< change as required
mydata = "='C:\[Mybook.xls]Sheet1'!$B$2:$F$12"

'link to destination worksheet
'<< change as required
With ThisWorkbook.Worksheets(1).Range("B2:F12")
.Formula = mydata

'convert formula to text
.Value = .Value

End With

End Sub
--
jb


"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



 
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
Excel 2003 - importing info from closed workbooks BJ&theBear Excel Discussion (Misc queries) 0 May 27th 10 09:05 PM
Need formula help linking closed excel files Steven Excel Discussion (Misc queries) 6 July 10th 07 05:50 PM
Lookup function Closed files Excel [email protected] Excel Worksheet Functions 3 January 12th 07 04:41 PM
why do all files get closed when i only close one in excel? carrie Excel Discussion (Misc queries) 1 November 28th 05 06:45 PM
Updating closed excel files [email protected] Excel Programming 1 May 9th 05 08:53 AM


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

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

About Us

"It's about Microsoft Excel"