Excel ActiveX: Count Rows

Hi, I am trying to simply count the used rows in an excel spreadsheet (which I have done in the past).
Attached is a simple vi which I am trying to get to work.  On my development PC, this works fine, counts the rows etc...on this PC I have Excel 2003.
When I create an EXE out of this VI and put it on another PC with Excel 2000, it returns "0" for the number of used rows.
Can ANYONE help me here, this is driving me insane.
Working in 7.1 (can use 7.0 or 8.0 if it makes it easier)
Thanks,
Ryan
Ryan
LV 7.1
Attachments:
test.vi ‏59 KB

It is limiting but I place the biggest blame on Microsoft for changing the properties and methods so much between different releases. You could put all of your Excel functions in a library that you call dynamically. That way, you don't have to re-build the exe but just distribute the library specific to whatever version of Excel you need to support. Unless you really need some specific Excel formatting, you could also save to comma/tab delimited text files. All versions of Excel can open them and you won't have to make a career out of modifying your application for as long as Excel is going to be around.

Similar Messages

  • SSRS 2008 R2 - Missing Data when Exporting to Excel or CSV (Row Count is 500)

    Hey Folks,
    When exporting SSRS 2008 R2 report  to an csv or excel file not all the rows are being exported. Any suggestions on why this is occurring. The number of rows is less then 500 and it seems to be a pretty straight forward export. Any help is
    greatly appreciated.  Inherited this and not sure if this would be configuration issues or something else. It is happening on a number of reports.
    Thanks.

    Hi Humbly,
    According to your description, when you export report into CSV or Excel format, some rows are missing.
    In your scenario, since you are missing data “rows” in your exported file, we are guessing if you have any visibility setting like toggle which hide those records. It’s possible that you have set toggle or visibility in your report. After exporting
    Excel/CSV, some data might not appear properly. In SSRS 2008 R2, it has reported this kind of issue about data missing after exporting. However, those scenarios are not exactly same as your issue. It mostly turns out be conflict between data and “layout render”
    and related to DataElementOutput property. DataElementOutput property controls export behavior, it indicates which report item data should appear in Excel/CSV render. For more information, please refer to this article: Reporting Services:
    Why aren’t all my report columns exporting to CSV and/or XML?.
    As we tested in our environment(SSRS 2008 R2), no matter what we export into CSV or Excel, we get same results as in BIDS . So I would like to know your report design structure. If possible, please provide some screenshots about results in BIDS and Excel/CSV
    render extension results. It may help us find out the root cause of your issue. Thank you.
    Best regards,
    Qiuyun Yu

  • Excel & ActiveX: Insert arbitrary columns from 2D array and create graph problems

    Hi there,
    I want to insert data from either a 1D or 2D array from LabView into Excel and create graphs.
    I used the information from the following example:
    http://www.ni.com/example/28934/en/
    and was able to create a new Excel file (I'm using Excel 2010), writing data from an 1D array to a column in excel by creating a while loop and using the first element of the array to write it to a specific cell. I use the counter of the loop to write to the next cell when the loop starts over and always delete the first value, which I write to the cell, from the array until it is empty.
    Now I also would like to write a 2D array - so the first column in Excel should be the first column from the array and so. Here I cannot use the loop counter directly as Excel only counts 1,2,... for the rows, but uses A,B,... to count columns. Also I do not know in advance how many columns my 2D array will contain, so creating a lookup table like (A means 1, B means 2,...) is not really an option (except there really is no other way). Is there a possibilty to convert numbers into letters or some way to 'explain' to the program that column 2 in the array means column B in Excel for example, or is there a way to insert new columns?
    I figured out how to add new Worksheets and as I also need to create a certain number of Worksheets and I know that on standard 3 sheets are present when creating the file, I use the 'add' methode to create every new worksheets before worksheet 3 - I could use the same methode to create new columns in Excel, but so far I didn't find a methode to do so. Or is there a way to enter the whole 2D array at once?
    Then I'd like to create a graph (in case of the 1D arrays a bar plot, when using 2D arrays a 3D plot) to view the data. I found this example:
    http://www.ni.com/newsletter/51339/en/
    -> as I do not have the toolkit I'd like to do it using ActiveX directly, so I tried to do things like shown under the headline 'DIY ActiveX/.NET'
    I tried to load the snippet to a new Excel file but got the error message 'microsoft.office.interop.excel.dll not found' and hence the code is not working. That confuses me a little as I would guess when this dll is not present I cannot access Excel from LabView at all, though my understanding of what I'm really doing so far is quiet limited. ;-)
    Also - as far as I understand from the snippet - when creating a new chart object I should be able the create methodes for it, however when I do a right click on the chart object of an ActiveX Worksheet symbol there are none listed.
    To explain my problems better I added a snippet showing my two problems: The inner of the two while loops shows how I import a 1D array. In the outer loop I seperate the columns. I know that currently this is not working as all data end up in column A of the Excel sheet - so I would need to convert the number of the outer counter to A, B,... or find a different solution.
    Moreover on the snippet I placed an ActiveX Worksheet Property with the Chart Object - as I can see the difference to the Chart Object in the example code from the last link above is the color. However I'm not sure what that means and how to change/ solve this.
    And just to make sure - I know this way the VI does not run as the Chart Object is placed completely wrong - I just did it, so it is included in the snippet.
    I'd be thankful for any suggestions,
    Thanks!
    Solved!
    Go to Solution.
    Attachments:
    ExcelAreaScan.png ‏60 KB

    Hello everyone and thanks for the answers.
    I only have the LabView Student Edition available here - is the toolkit included in it too. How can I check if it is installed/ available and in case it is installed - where can I find it?
    Today I had time to take a look at the example
    Create via ActiveX Labview a XY Scatter plot graph on an excel sheet
    It almost does what I want in terms of creating a graph. The only problem I could not fix, is that in this example a sheet is created where only the graph is present. i'd like to add the graph to a previously created worksheet. Today I tried get this working but it seems I stilll don't really understand what I'm doing, I'll post a snippet of my code as soon as I can access the PC with LabView on it again.
    I also took a look at the other example for inserting 2D attays - it seems to be what I need, I just had no time so far to test it, I'll post an update when I could test it.
    Thanks for the help so far!

  • Download to Excel is hiding rows in a pivot view

    Hello ,
    When downloading a report to excel from OBIEE Dashboard , certain rows are getting hidden . For instance , I have total 15 rows in my pivot view and when I download that report into excel format , the rows from 8-13 are not showing up . After 7th row I see 14th row .
    But when I download the same report from Answers I can see all rows in the pivot view .
    I tried looking at the formatting options of the pivot view and everything is normal . This is happening only with this particular report , other reports in dashboard download normally .
    Please let me know if anybody has ideas .
    Thank you
    Karthik

    karthik,
    From where ur downloading to excel ...use the download option available at "preview " button ,if you are using the same go with report links download button option
    Last option create a new report (without any filters in case if u have)
    Thanks,
    Saichand.v

  • Excel ActiveX error in exe: library not registered

    Hi,
    I wondered if any of you can help me as I'm at a bit of a
    loss. I have an application that is complied to exe, and installed with
    an installer in LabVIEW 8.5.1 that uses the Excel ActiveX interface to
    write to an xls file. In development and on all of my testing this
    seems to work fine (with Excel 03 and 07) but I have just received a
    bug report whereby on a particular install the following error has been
    thrown form my Open Excel VI (see attached code). Apparently it was
    working but this machine has recently upgraded some data management
    software (Goldmine 6.0 -> 7.5) and since then it hasn't worked.  The error generated is:
    Error code:-2147319779
    source: "Library not registered."
    Troubleshooting
    is complicated a little as this is running as an exe and the source
    code seems to work fine on my development machine.
    Any ideas would be GREATLY appriciated!
    (my current inclination is to ask the customer to resintall Office and
    Goldmine and then reinstall the LabVIEW app - so far he has only tried
    reinstalling the LabVIEW software)
    Shaun
    (this message is also posted on Lavag.org = http://forums.lavag.org/Excel-ActiveX-error-in-exe-library-not-registered-t11912.html)
    Attachments:
    Open Excel.vi.png ‏52 KB

    It would really help to see the relevant code, and to know which version of LabVIEW is being used.  I notice the original code was developed on LabVIEW 8.5, and the Poster mentions older versions of Office (and is writing an .xls instead of an .xlsx file), suggesting the original code is about 7 years old.
    About 4 years ago, I got frustrated with trying to use ActiveX, and NI developed a much more robust Report Generation Toolkit.  I've adopted the RGT and haven't looked back.  Most of the weird errors I used to fight are gone, and building executables is (mostly) no pain (there's a small glitch that required manual OK-type intervention when you first encounter the Toolkit in a Build).  I'm guessing that it should be pretty easy to rewrite your code using the RGT in place of ActiveX, and I'm willing to help ...
    Bob Schor

  • Count rows from multiple tables using SQL only

    Hi, I know this has probably been answered before, but I couldn't find the answer anywhere. Please help.
    I'd like count(*) [rows] for all tables in database using SQL only - no PL/SQL
    The result should be something like:
    Table RowCount
    DBA_TABLES 1000
    DBA_USERS 50
    etc.
    Thanks!

    offcource write this script:
    create or replace procedure count_tables (ip_schema VARCHAR2)
    is
    lv_owner VARCHAR2(100);
    lv_table_name VARCHAR2(100);
    lv_sql_statement VARCHAR2(2000);
    lv_count_table NUMBER;
    CURSOR c1 IS
    SELECT owner, table_name
    FROM all_tables
    WHERE owner = ip_schema
    ORDER BY table_name;
    begin
    dbms_output.put_line ('+--------------------------------------------------------------------+');
    dbms_output.put_line ('¦ | | ¦');
    dbms_output.put_line ('¦ Schema Name | Table Name | Number of Rows ¦');
    dbms_output.put_line ('¦ | | ¦');
    dbms_output.put_line ('¦------------------------------------------------------------------¦');
    OPEN c1;
    LOOP
    FETCH c1 INTO lv_owner , lv_table_name;
    EXIT WHEN c1%NOTFOUND;
    lv_sql_statement := 'SELECT count(*) FROM ' || lv_owner || '.' || lv_table_name;
    EXECUTE IMMEDIATE lv_sql_statement INTO lv_count_table;
    IF lv_count_table > 0 THEN
    dbms_output.put_line ('| '||rpad(lv_owner, 14, ' ')||'| '|| rpad(lv_table_name, 32, ' ')||'| '|| rpad(lv_count_table, 16, ' ')||' |');
    -- dbms_output.put_line ('|---------------|---------------------------------|------------------|');
    END IF;
    END LOOP;
    CLOSE c1;
    dbms_output.put_line ('+--------------------------------------------------------------------+');
    exception
    WHEN OTHERS THEN
    dbms_output.put_line ('owner: '||lv_owner||' - table: '||lv_table_name||' - '||sqlerrm);
    end count_tables;
    set serveroutput on size 1000000
    exec count_tables
    drop procedure count_tables;

  • Count rows from several tables

    hello,
    im trying to count row from multiple tables
    for example i need the select statement to produce the following
    table_name count
    table1 5
    table2 6
    table3 3
    i came up with the following script but it counts the number of tables i have
    select object_name, (select count(*) from user_tables where table_name = object_name) from all_objects
    where object_type = 'TABLE'

    Manik wrote:
    May be possible:
    Check this:
    SELECT table_name,
    TO_NUMBER (
    EXTRACTVALUE (
    xmltype (
    DBMS_XMLGEN.getxml ('select count(*) c from ' || table_name)),
    '/ROWSET/ROW/C'))
    COUNT
    FROM (select * from all_tables where table_name in ('TABLE1','TABLE2'))
    WHERE owner = 'SCOTT';Cheers,
    Manik.Awesome Manik... Just too good. Thanks.
    I wish i could have given you the 'Correct' points. ;-)
    Can you please explain the logic in brief? Will be helpful for everybody to understand...

  • SQL Developer 2.1 EA - count rows with filter on a table

    This is a small problem that I came across today while using 2.1 EA. I opened a table and did a filter to narrow down the results of the table. Then when I right clicked on the search results and clicked on 'Count Rows'....I get the count of the rows in the table and not my search results.
    Is this a feature or a bug?
    Thanks,
    Mike

    In EA2, we get both the total and the filtered total, nice.
    Only remark is we don't get a progress indicator anymore, and thus can't cancel a query that might take up hours to finish!
    Please log a bug for this.
    Thanks,
    K.

  • Count rows in an internal table

    Anybody how knows how I can count rows in my internal table?

    Hi,
    Data: lines like sy-tabix.
    DESCRIBE TABLE ITAB LINES LINES.
    where itab is your internal table.
    This will work out.
    Please award sutiable points .
    Regards,
    Irfan

  • How to set Tile count column or count row?

    How to set Tile count column or count row? If not can do, How
    to adjust count row or count column?
    Thx for all idea.

    The Tile container's number of columns and rows is calculated
    based on each child's width and height (or based on tileWidth and
    tileHeight which you can set). If you need more control over the
    layout, use Grid.

  • Can i count row from ResultSet ?

    I would like to count row from ResultSet for
    take it into my array object because i must know number of row before create array object.
    Example:
    ResultSet rset = stmt.executeQuery("select * from user ");
    /*i = amount of ResultSet*/
    User[] user = new User;
    int l=0;
    while (rset.next()){
    user[l] = new User();
    user.name = rset.getString(1);
    l++;

    Hi,
    As per my knowledge there is no method by which you can get the count of items in a resultset directly. You will have to loop through the reseltset and set a variable for count. In your specific case I would advise you to use a Vetor instead of an array so that you need not bother about the size.
    ResultSet rset = stmt.executeQuery("select * from user ");
    Vector user = new Vector();
    while (rset.next()){
    user.addElement(rset.getString(1));
    Now you will have a Vector that holds the user info. To retrieve the user info loop through the Vector.
    for (int i; i<user.size(); i++){
    userName = user.elementAt(i);
    Hope I was of some help.
    cheers!!!
    Nish

  • Count rows that are max timestamp

    Hi,
    I'm trying to run a query that will count only rows that are max timestamp.
    i have a submit table which has dates of submissions, however some application numbers have multiple rows in this table. I need to count only one row per application and it has to be the latest submission data.
    I have tried a subquery and its not working, I'm stuck at this point.
    Thanks for help :)
    example table
    pk app # submit_date
    12 test-1 02222011 13:30
    13 test-2 02232011 09:45
    14 test-1 02232011 09:51
    how do i count rows but based on max timestamp?

    select
    count(s.pk)
    from
    submit s
    where exists (select s1.app#, max(s1.submit_date) from submit s1 group by s1.app#)
    I dont really understand what you are doing there.
    SQL> WITH T
      2       AS (SELECT 12 pk, 'TEST-1' app#, SYSDATE submit_date FROM DUAL
      3           UNION ALL
      4           SELECT 13 pk, 'TEST-2' app#, SYSDATE + 1 submit_date FROM DUAL
      5           UNION ALL
      6           SELECT 14 pk, 'TEST-1' app#, SYSDATE + 2 submit_date FROM DUAL)
      7  SELECT * FROM T;
            PK APP#   SUBMIT_DA
            12 TEST-1 23-FEB-11
            13 TEST-2 24-FEB-11
            14 TEST-1 25-FEB-11
    SQL> WITH T
      2       AS (SELECT 12 pk, 'TEST-1' app#, SYSDATE submit_date FROM DUAL
      3           UNION ALL
      4           SELECT 13 pk, 'TEST-2' app#, SYSDATE + 1 submit_date FROM DUAL
      5           UNION ALL
      6           SELECT 14 pk, 'TEST-1' app#, SYSDATE + 2 submit_date FROM DUAL)
      7  SELECT   pk, app#
      8    FROM   (SELECT pk, app#, ROW_NUMBER () OVER (PARTITION BY app# ORDER BY submit_date DESC) rn
    FROM T)
      9   WHERE   rn = 1;
            PK APP#
            14 TEST-1
            13 TEST-2
    SQL>

  • What is the problem with native dynamic sql when counting rows in all table

    what is the problem with native dynamic sql when counting rows in all table?Giving an error "table or view does not exist". Thanks.
    DECLARE
    v_sql_string varchar2(1000);
    v_no_of_rows number;
    BEGIN
    for i in ( select table_name from all_tables )
    loop
    v_sql_string := ' select count(1) from ' || i.table_name;
    dbms_output.put_line( v_sql_string );
    --execute immediate v_sql_string into v_no_of_rows;
    end loop;
    END;

    Usually your problem can be described with 'Who cares'. I mean, for what reason do you do this? I doubt that there's a business need to get 100 % accurate answers for this. Normally such things are used to get a picture about the growth of data.
    Personally I would prefer to have up-to-date statistics for all tables and just query the number of rows from there. Sufficient for me in < 99 % of all cases.
    Just my $ .02...

  • Excel ActiveX Development

    Hi all,
    I would like to know where I can find some guidance and examples on Excel ActiveX development.  Is there a thread dedicated to Excel development in LV?
    Basically all I want to do is create a report in Excel based on some control values etc within a VI.
    I don't have Report Gen Toolkit and don't want to purchase.  I have seen that it can be done using ActiveX functions.  Is this the way to go?
    Thanks for your help!
    Battler.

    The excel board is located in the breakpoint:
    http://forums.ni.com/t5/BreakPoint/Excel-Board/m-p/379682
    And yes, if you don't want to purchase a toolkit, using ActiveX on your own is the way to go.
    Felix
    www.aescusoft.de
    My latest community nugget on producer/consumer design
    My current blog: A journey through uml

  • Excel ActiveX slow when not connected to internet

    Using LabVIEW 8.5
    I hope someone has some insight into this problem because I'm lost. I have a program that communicates with a VXI instrument using a direct connection (crossover cable). I have a subVI in the program that takes data already in the program and writes it to an exisitng Excel workbook using ActiveX. When I run this subVI by itself when I have internet access (DHCP enabled), the subVI takes <2 sec to complete. However, when I am conencted to the instrument using a crossover cable, the subVI occassionally (about 1 out of 3 runs) takes >13 sec to complete. As a test, I connected back to my normal network but kept the manual TCP/IP settings (so Local Area Connection shows a network connection but I can't access the internet). I got the same result, with the subVI taking >13 sec to complete at time. Can anyone explain this behavior? Any remedies? I assume Excel or ActiveX is trying to access the internet, but that doesn't make a lot of sense.
    Perhaps a related issue is when I don't have internet conection LabVIEW has problems updating the Block Diagram (i.e. a right click on a wire takes several seconds to bring up the shortcut menu and causes LabVIEW to freeze). Any rememdy for this? I don't know if it is completely related to the issue above, because I created an installer of the subVI and it still exhibits the same behavior (unless maybe its a LabVIEW Run TIme issue?)
    I've attached the necessary VI's. To test you'll need to create some Excel workbook and then change the File Path control in the subVI. Also change your TCP/IP settings to something random (I use 192.168.0.2, sub 255.255.255.0, gtwy 192.168.1.1, dns 192.168.1.2, alt dns 192.168.1.3). Any suggestions welcome, or even verification of the behavior I've described.
    Thanks
    Michael
    Attachments:
    WriteExcelExistsTEST.vi ‏113 KB
    Row Col To Range Format.vi ‏17 KB

    Thanks for the response. I tried several different ActiveX applications like you suggested including: Microsoft Word 12.0 Objects Library Version 2.4,  Microsoft Internet Controls Version 1.1 Internet Explorer IWebBroswerApp, Microsoft Outlook 11.0 Object Library Version 9.2 Application, etc. The only one I could get to exhibit the same behavior as the Excel app was Microsoft Visio 11.0 Type Library Versionn 4.b, and thats because Visio itself opens when I run the Automation Open then Close.
    I then tried opening both Excel and Visio seperately by double clicking their link instead of using LabVIEW and ActiveX with the changed TCP/IP settings , and the same behavior was shown; occassinally it would take about 12 sec to open. So it must not be an ActiveX issue but something with Excel and Visio and my computer (since you didn't see the same behavior on yours). I guess I'll have to go searching the web for an answer...
    For completeness and to answer your questions, the environment does not have an internet connection (see first post, network created by a computer with a crossover cable to a VXI-11 instrument). Using Windows XP and Office 2003
    Michael

Maybe you are looking for

  • HT203433 Problem with purchase on itunes

    I purchased one song on itunes and the downlaod didn't work (a message was displayed saying that the file was corrupted). the amount of the purchased though, has been debited from my account. Thanks.

  • How do I update my itunes to 10.5 or higher

    My Iphone will not update; an error always takes place when I try to update.

  • Swift Net MT-103 Interface with SAP

    Hello all, I am having a hard time to understand the concept and reason to use the Swiftnet MT103 (Outgoing Payment). 1)At what point I will consider MT103 solution versus EDI820 (Outgoing Payment)? 2)What will be the considerations I need to take pl

  • Error :Could not connect to SAP systemSAP_R3_PLM

    Hi, I have uploaded the Business Package for projects into portal and assigned the iviews to a user(test_abc)...when iam trying to view the iviews by logging in to "test_abc" iam getting the following error: <b>Could not connect to SAP systemSAP_R3_P

  • Why doesn't my iMac Restart?

    Suddenly I noticed that my iMac wouldn't restart, it freezed with a white screen after giving to tone of restarting. I tried several times but the same thing occured. Then I thought it could be because I always had my iPod connected (although this sh