dear user
i have open exsisting excel in following code and read the first cell in excel.
but display the following error![]()
Please Login or Register to view this content.
runtime error 1004
Method 'Cells' of object '_Application'failed
thanks:![]()
dear user
i have open exsisting excel in following code and read the first cell in excel.
but display the following error![]()
Please Login or Register to view this content.
runtime error 1004
Method 'Cells' of object '_Application'failed
thanks:![]()
Last edited by Leith Ross; 08-28-2009 at 02:45 AM. Reason: Added Code Tags
I dont get the same error Do you have the code in "This workbook"
You could try.
![]()
Please Login or Register to view this content.
Please when you post on the forum can you wrap you code in code tage, It makes it a lot ease for people to read and copy.
You can do this by placing [code ] at the start of the code and [/code ] "without the spaces
Hope this helps
The error is because the application object does not have a cells property.
Worksheets and ranges have a cells property.
Edit: As lecxe correctly points out Application does have a Cells property. It refers to the activework books activesheet.
So note to self. Don't test lines of code without first opening a workbook.
Last edited by Andy Pope; 08-28-2009 at 05:57 AM.
Hi excel2010
The Cells property of the Application object refers to the cells in the active sheet.![]()
Please Login or Register to view this content.
You get an error if the active sheet is not a worksheet.
I guess that in your case the active sheet when you opened the file was a chart sheet.
You should change this statement and specify the worksheet, for example like D_Rennie suggested or using a worksheet name.
HTH
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks