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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding Excel Content (*with* Worksheet Reference)

Status
Not open for further replies.

waldemar

Programmer
Nov 15, 2001
245
DE
I opened an Excel File like this:

Dim Excel As Object
Set Excel = CreateObject("Excel.application")
Excel.workbooks.Open (strFilename)

Now, I', looking for a way to access speific cells in the way

"Sheet!A1" or
"Sheet!A1:B2"

Through the Cells Property I would need split these "Path-References" in columns and lines (Cells(2,2)). Does anyone know a way of using the complete path like this strContent=Excel.Cells("Sheet!A1") ??

Thanks a lot in advance!
 
Try

strContent = Excel.sheets("Sheet").range("A1")

Rob
 
Thanks Rob. Is this the only way? (Want to avoid the hazzle of parsing the reference strings...)
 
No, come to think of it, you can also use:

excel.evaluate("sheet!A1")

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top