Forum Discussion
var sheet = book.Sheets(desiredSheetName)
Instead of this line, Can you try using below,
var sheet = book.Sheets.Item(desiredSheetName);
It works fine for me long time.
Hy Shankar,
I am unable to access 'book.Sheets' alone... it crashes here. How am i supposed to get past it?
Please view the attached images in previous posts and read the text again under "//Issue 02 (Intellisense popup)".
Thanks & regards,
Shirwani
- shankar_r7 years agoCommunity Hero
This error is not related TestComplete use case, It is part of Excel settings.
I tried the same code with my machine it is working fine. [TC 12.42].
Does your excel sheet have any Macros?
When you open your excel workbook, does is shows Enable Editing?
Are there any recent Excel upgrade you did?
- obaid_shirwani7 years agoContributor
Shankar, I am not using any macros. The problem is beyond file enabled or disabled for editing.
However as pointed out in message three in this thread above, i too doubt that this seems to be related to some version conflicts. I have provided details for all related software I am using.
The issue at hand still stands that why is TestComplete trying to open the excel file during Code Development and why is it throwing the wrong message at code execution? The workbook is getting opened by code and object get returned successfully and file gets locked for manual manipulation, The error message 'book.Sheets is not a function' is wrong as I can see this property in the workbook object. I have the shot attached in above posts.
- shankar_r7 years agoCommunity Hero
You would probably need to create a support ticket.
Related Content
Recent Discussions
- 3 days agoMW_Didata