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

Accessing Excel data from within Word

Status
Not open for further replies.

AcousticalConsultant

Technical User
Sep 20, 2001
45
CA
Hi,

I'm trying to automate a report in Word based on data entered in an Excel spreadsheet. So far everything's working, I just need Word to look at a specific cell in excel and write a sentence based on what it finds. For example, I know this is wrong, but this is what I tried:

If (Excel.Range("A1") = 0) Then
.
.
.
End If

Both Word and Excel are opened, and the documents in question are also open. All I need to do is verify that cell.

Thanks!
 
here are some xcel object:
sub sdf()
Dim xlExcel, xlBook, xlSheet As Object
Set xlExcel = GetObject(, "Excel.Application")
Set xlBook = xlExcel.activeworkbook
Set xlSheet = xlBook.ActiveSheet
MsgBox xlSheet.Range("A1").Value
end sub

if your xl application runs, it displays the value of A1 range of the activesheet
ide
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top