This may sound like a stupid question but do you have the file open already when you try to run this code? You can right click on the node and select Ignore Errors inside the Node but I'm not sure if it will still give you a worksheets reference ID out.
1st thing - My excel sheet is not open.
2nd thing - I am getting error in invoke node(That is workbook invoe node) and ignoring error in invoke node is not possible. We can ignore only in property node.
This error can have different sources but in your case I would guess this is a local ID issue. Is your machine locale set to something else than US English? Have a look at this link.
Also, Sheets Item Index is NOT zero base, this will throw another error. Index of the first sheet of a workbook is 1.
I tried with different solution mentioned by you all, now it is fixed. Below is my solution. Thanks to all for your help and patience in providing solutions.
1. Excel sheet should be in xls format. I changed my xlsx format to xls format.
2. Changed index of sheet to 1 from 0.
But i need one more small clarification. I there any way of using xlsx format instead of xls format?
I would make sure there are no previous instances of excel open from when you were closing your references in the wrong order. You can check by opening task manager, then looking through the processes and aborting all the excel references and trying your code again. I've gotten errors before when there have been previous references still open in task manager when dealing with Excel using active X. Not saying this is the root cause of your error but its a simple check.
I generated an xlsx file and opened it using active x with no errors. But this was a fresh blank spreadsheet. There maybe something in your spreadsheet causing this error you are seeing, or your Object Library your have selected for your open active x application is maybe incorrect. Which Library are you using. I believe Excel 2010 using version 14.