UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Get Excell cell value    
 
   
bobdee
post Jun 3 2006, 03:14 PM
Post #1

UtterAccess Guru
Posts: 877



I'm able to open the Excel workbook and worksheet using:

CODE
Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Open _
(Me.ImportFile)

Set oSheet = oBook.Worksheets(WorkSheetName)
ValueofCell = oSheet.Cells(CellName).Value


Let's not get hung up on declarations and where WorkSheetName and CellName come from. This all works okay and appropriate declarations are in my code.

My problem is with the ValueofCell statement. CellName is in the form 'A25', 'F15', etc. Whereas oSheet.Cell requires row number and column number.

Is there an alternative to Cells or can I convert A25 to Row 1 Column 25 in code.

Thanks.
Go to the top of the page
 
+
maximus_cat
post Jun 3 2006, 07:17 PM
Post #2

UtterAccess Enthusiast
Posts: 83
From: Leeds, UK



If I recall correctly, you can use:
CODE
ValueofCell = oSheet.Range(CellName).Value
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th June 2013 - 06:13 AM