ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error retrieving value of the specified Excel cell (Not active) (https://www.excelbanter.com/excel-programming/291232-error-retrieving-value-specified-excel-cell-not-active.html)

jack

Error retrieving value of the specified Excel cell (Not active)
 
I am trying to retieve content of specified (row, column) cell.

Set oExcel = GetObject(, "Excel.Application") ' get existing Excel Object

oExcel.Cells(11, 17).Value

The above code works fine in Immediate window but in run time creates error:
'438': Object doesn't support this property or method"

How to retrieve value of the specified cell (Not active) ?



Slava Solovei

Error retrieving value of the specified Excel cell (Not active)
 
try

oExcel.ActiveWorkbook.ActiveSheet.Cells(11, 7).Value


--
At least one sentence in this post is wrong, but it could be this one
(paraphrased).
"Jack" <replyto@newsgroup wrote in message
...
I am trying to retieve content of specified (row, column) cell.

Set oExcel = GetObject(, "Excel.Application") ' get existing Excel Object

oExcel.Cells(11, 17).Value

The above code works fine in Immediate window but in run time creates

error:
'438': Object doesn't support this property or method"

How to retrieve value of the specified cell (Not active) ?





Sue Harsevoort

Error retrieving value of the specified Excel cell (Not active)
 
Is oExcel.Cells(11,17).Value the whole line or is it something like:

CellValue = oExcel.Cells(11,17).Value

If what you typed is the whole line in your program, then I think that is
your problem, you need to assign the value to something.

Sue

"Jack" <replyto@newsgroup wrote in message
...
I am trying to retieve content of specified (row, column) cell.

Set oExcel = GetObject(, "Excel.Application") ' get existing Excel Object

oExcel.Cells(11, 17).Value

The above code works fine in Immediate window but in run time creates

error:
'438': Object doesn't support this property or method"

How to retrieve value of the specified cell (Not active) ?






All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com