Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying live data from one copy of excel to another - please help.

Status
Not open for further replies.

Mightyginger

Programmer
Feb 27, 2003
131
US
I have 2 copies of excel open on one machine. One has spreadsheet "master" open and it calculates prices, the second one "slave" needs to have these linked live prices constantly updated. I don't want to open both workbooks in the same copy of excel because of the chance of it crashing so it has to be set up this way. My question is what is the easiest way to get the live prices into a workbooks in one copy of excel from a workbook open on the same machine but running a different workbook.

Any advice would be appreciated.



Neil.
 
Something like this will copy the entire sheet's content's from one workbook to a specific sheet's range (A1) in another:

Workbooks("Slave.xls").Sheet1.cells.copy Destination:=Workbooks("Master.xls").Sheet1.Range("A1")

I hope this helps!



Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
Thanks Mike but the problem is that they're open in DIFFERENT copies of excel. So that code won't work. At the moment I'm just writing a bit of code to dump the prices to a database everytime the sheet is recalculated and the other excel reads in the prices from the database.
 
Summat like this should get you going - you would put this in the "master" workbook:

Dim ObjExcel As Excel.Application
Set ObjExcel = GetObject(, "Excel.Application")
With ObjExcel
With Workbooks("Slaveworkbookname").Sheets("SheetToPutDataIn")
.Range("A1").Value = ThisWorkbook.Sheets("SheetToPullDataFrom").Range("A1").Value
End With
End With

Rgds, Geoff
[blue]Quantum materiae materietur marmota monax si marmota monax materiam possit materiari?[/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
OK, I'm lost . . . Did you even try it?





Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
Sorry Mike but I get a subscript out of range error with your code

Rgds, Geoff
[blue]Quantum materiae materietur marmota monax si marmota monax materiam possit materiari?[/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top