PDA

Click to See Complete Forum and Search --> : Importing cell info from EXCEL


shastri_s
Nov 8th, 1999, 01:43 AM
You can use DDE by setting the Linktopic, Linkitem and Linkmode properties.

Alternatively , you can use OLE Automation to achieve this.
With DDE,
Set Linktopic = excel|sheet1
linkitem = r1c1
linkmode = automatic

You can also dynamically change the linkitems to access diff. cells.

Hope this is useful

billwagnon
Nov 8th, 1999, 07:42 AM
Public myXL As Object

Sub LoadInformationFromExcel()

Dim strActiveCell As String

Set myXL = CreateObject("Excel.Application")

myXL.Visible = True
myXL.Workbooks.Open FileName:="C:\1231Plans.xls" 'your file name here

With myXL
.Workbooks("1231plans.xls").Activate
.Range("a2").Select 'or whatever
strActiveCell = .ActiveCell
'other operations / routines
End With

myXL.Quit

Set myXL = Nothing

End Sub

Be sure to set your Excel reference on the project.

[This message has been edited by billwagnon (edited 11-08-1999).]

salmrp
Nov 8th, 1999, 11:51 AM
Please send a sample of code to access a cell in a EXCEL spreadsheet. What is the easiest way to do this? Thanks.