Forum Discussion
Hi Martin,
I had obviously checked that before posting. The returned Workbooks object holds the number of Sheets available in the file. So i think that is not the issue. I am attaching the screenshot for the object returned.
The visible class is throwing error. I assume it might be some version conflict or the driver issue.
Best regards,
Shirwani
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.
- obaid_shirwani7 years agoContributor
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.
Related Content
Recent Discussions
- 3 days ago