Excel Automation

D

david.goodmanson

Hi Excellers,

I am wanting to automate an existing excel workbook to go to other
existing workbooks and retrieve data from those workbooks (without
creating manual links). I'm hoping I can get some example code to use
that I can pick up on and apply. Perhaps this code be similar to:

dim XL as Excel.application
dim Wb as workbook

set xl = ???
set wb = ???

etc. etc.

Thanks

David
 
G

Gary''s Student

Right from the Recorder:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 2/29/2008 by James Ravenswood
'

'
ChDir "C:\Documents and Settings\Owner\Desktop"
Workbooks.Open Filename:= _
"C:\Documents and Settings\Owner\Desktop\Book2.xls"
Sheets("Sheet2").Select
Range("B10").Select
Selection.Copy
Windows("Book1.xls").Activate
Range("A19").Select
ActiveSheet.Paste
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top