01-01-2014 12:55 AM - edited 01-01-2014 12:56 AM
Hi,
I am trying to get the handle of an Excel file using the attched code. This works fine when I have only opened excel application without any workbooks opened so the window title is "Microsoft Excel". When I open a file, the title changes to eg. "Book1 - Mocrosoft Excel" or "Book1.xlsx - Microsoft Excel" (depending on whether I have saved Book1 or not) and the code doesn't work if I input these names.
What I am doing wrong in here?
SL
01-01-2014 12:03 PM
@solanki2 wrote:
Hi,
I am trying to get the handle of an Excel file using the attched code. This works fine when I have only opened excel application without any workbooks opened so the window title is "Microsoft Excel". When I open a file, the title changes to eg. "Book1 - Mocrosoft Excel" or "Book1.xlsx - Microsoft Excel" (depending on whether I have saved Book1 or not) and the code doesn't work if I input these names.
What I am doing wrong in here?
SL
Why don't you use ActiveX? This following code gives you the name of the active workbook.
Ben64
01-01-2014 12:59 PM
@ben64 wrote:
Why don't you use ActiveX? This following code gives you the name of the active workbook.
Ben64
Ben, I little micronugget for you.
WHAT! How did I do that with one P-Node.!
When you create the property node and right click to select a property- choose Browse... (right at the top) any properties that return references can be expanded until you get the property you are really interested in. Expert TIP: choose Name Format.Long Names when you do this to make the code more readable. The BD cost is minimal compared to having multiple P-nodes with short names.
01-01-2014 01:21 PM
01-01-2014 11:51 PM
Thak you very much guys. I was using AcitveX but, the problem was in the Call Library Function Node. It was not generating the handle properly due to wrong data type I've used. Changed it to Unsigned Pointer-sized Integer from U32 and it is happy now.
Thanks again for the useful tips though.