LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Activex Excel get workbooks not working

I am new to the ActiveX Excel functions, but I seem to be running into a problem with some of them - 

 

I can run example1, and example2 no problem, but when I try to run the function 'excel get workbooks', it returns none, even though there are some open (the ones created by the examples).

 

I dug into the code, and it seems to rely on a password protected piece of code 'excel objectRepository' - and I beleive it is this piece of code that is failing, as it returns empty results when run.

As this objectRepository piece of code seems to be used in many excel functions - I'd like to get it going.

Unfortunately it is password protected, so I cannot dig into it.

 

I got the impression this piece of code depended on 'GOOP' - is this true, and if so, is this now included as part of LV 2011?

 

 

The funny thing is, I create my own activeX calls to get all workbooks, and then get the names of each workbook, and this works.

 

Can anyone using LV2011 and office 2007 (or similar LV/office combo) comment on whether excel get workbooks works for them?

 

Thanks in advance for any help or ideas.

 

0 Kudos
Message 1 of 7
(3,654 Views)

What examples are you referring to?

0 Kudos
Message 2 of 7
(3,645 Views)

I was referring to 'example2' that is provided with the excel functions (the excel functions are shown in action here)

 

I figured out part of the issue  - it seems the 'excel get workbooks' function only returns workbooks it has created itself while the current VI has been running - it does not query the actual workbooks that excel has open, which was what I was expecting.

 

0 Kudos
Message 3 of 7
(3,637 Views)

You said you figured out part of the issue. Is there still another?

0 Kudos
Message 4 of 7
(3,632 Views)

Well, the remainder of the issue is - 

 

If I want to get a list of all open work-books in excel, not just the ones created by these vis, how can I do that?

 

I can get the list or workboos another way - by using the low-level activex calls directly, but proble then is the workbook references returned by that are not compatible with the excel vis, as they use a custom reference/data-type to handle the excel files.

 

 

 

 

0 Kudos
Message 5 of 7
(3,622 Views)

I cannot find the "excel get workbooks" function in the toolkit. Did you download the one that's posted in the second message in that thread, or a different version?

 

That library uses GOOP, and some GOOP stuff was included with LabVIEW. The GOOP object was designed to only keep track of the currently opened Excel application, and the currently opened workbook and the currently opened worksheet, as well as some other information. The individual VIs unbundle the information and make the ActiveX calls.  NI's Report Generation Toolkit does the same thing - ultimately both have to eventually get down to the ActiveX calls. However, NI's Report Generation Toolkit is based on classes usinv LVOOP.

 

In terms of your issue, what are you trying to do with the other workbooks?

0 Kudos
Message 6 of 7
(3,612 Views)

I downloaded it from this message:

http://forums.ni.com/t5/LabVIEW/problem-using-ActiveX-for-excel-app-to-determine-row-col-no-s/m-p/19...

 

(message 8, from EvenDeejay's attachment) - I did not find a link or page that gave the latest version - but this version has excel get workbooks - 

 

The vi in the functions panel I see is here:

panel.png

 

0 Kudos
Message 7 of 7
(3,602 Views)