Open new Excel sheet when number of rows is too big

Hi again,
I'm using ActiveX to write some data to Excel. It is common that the amount of data that I want to write to Excel takes more than the 65536 rows of a sheet, so every time this number of rows is reached I wanted to open a new sheet and write data to it and so one. The writting part is alrigth (I adapted the Write Table to XL.vi), I can see the row current row number I am writting data to and I now how to open the new sheet and write to it. The problem is that I don't seem to find a way to open the new sheet only once after the row nº is greater than 65536...  I don't know where to test the row number...I join my code if you have some time to look at it, any suggestion would be of great help.
I hope you understand my problem...
Best regards,
Isabel

Here is the change that I suggested.  I use the modulus for simplicity to wrap the 65535 back to 0.  A new sheet is added only when the row and column indexes are both at 0.  The shift registers are used to hold the current value of the Sheet reference.
I also correct several bugs in your code with comments on why.
The nested for loops used is the Example code is only suitable for a small amount of data.  The proper way to transfer a large array to Excel is with a Block Write.  Your data array would need to be broken into worksheet-sized chunks and written with a single Range->Value write using the double indexed data.
Michael Munroe, ABCDEF
Certified LabVIEW Developer, MCP
Find and fix bad VI Properties with Property Inspector
Attachments:
Write Table & Header to Excel large import_mod.vi ‏92 KB

Similar Messages

  • How to add a new excel sheet  when the row count exceed more than 65 k

    am working on business intellignence am able to export the data to excel sheet but my data exceeds the sheet limit so how to add to another sheet when the last row is hit ..???
    any suggestions warm welcome...
    help me to fix this issue...

    You've not specified how you're generating the Excel file. Are you using POI? JExcel? What?
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • Error while opening the EXCEL Sheet from a Report Program

    Hi All,
    I am getting an error saying 'SYLK: File Format is not valid' when my program is trying to open an excel sheet. I am using the function module WS_EXCEL to download it to excel sheet.
    Following is the code:
    Excel download
    types: begin of t_excel,
             c01(20),
             c02(20),
             c03(20),
             c04(20),
             c05(70),
             c06(20),
             c07(20),
             c08(20),
             c09(20),
             c10(20),
           end of t_excel.
    data: a00_excel type standard table of t_excel.
    concatenate 'C:\' sy-repid sy-uzeit 'FILE01' '.xls' into z_fname.
    condense z_fname no-gaps.
    call function 'WS_EXCEL'
          exporting
               filename = z_fname
          tables
               data     = a00_excel
          exceptions
               others   = 1.
    if sy-subrc ne 0.
       message e019(zsd).
      Download to Excel failed.
    endif.
    a00_excel contains the data that is to be downloaded into the excel sheet. I used the same code in the other program it is working fine. If you see in the type declaration for C5 its 70 characters, i tried putting it as same as others to 20... still it doesnt work.
    Thank You,
    Suresh

    Not sure man,  your code works ok for me.
    report zrich_0001.
    types: begin of t_excel,
    c01(20),
    c02(20),
    c03(20),
    c04(20),
    c05(70),
    c06(20),
    c07(20),
    c08(20),
    c09(20),
    c10(20),
    end of t_excel.
    data: a00_excel type standard table of t_excel.
    data: x00_excel like line of a00_excel.
    data: z_fname type string.
    x00_excel-c01 = 'A'.
    x00_excel-c02 = 'B'.
    x00_excel-c03 = 'C'.
    x00_excel-c04 = 'D'.
    x00_excel-c05 = 'E'.
    x00_excel-c06 = 'F'.
    x00_excel-c07 = 'G'.
    x00_excel-c08 = 'H'.
    x00_excel-c09 = 'I'.
    x00_excel-c10 = 'J'.
    append x00_excel to a00_excel.
    x00_excel-c01 = 'K'.
    x00_excel-c02 = 'L'.
    x00_excel-c03 = 'M'.
    x00_excel-c04 = 'N'.
    x00_excel-c05 = 'O'.
    x00_excel-c06 = 'P'.
    x00_excel-c07 = 'Q'.
    x00_excel-c08 = 'R'.
    x00_excel-c09 = 'S'.
    x00_excel-c10 = 'T'.
    append x00_excel to a00_excel.
    concatenate 'C:' sy-repid sy-uzeit 'FILE01' '.xls' into z_fname.
    condense z_fname no-gaps.
    call function 'WS_EXCEL'
         exporting
              filename = z_fname
         tables
              data     = a00_excel
         exceptions
              others   = 1.
    if sy-subrc ne 0.
      message e019(zsd).
    *  download to excel failed.
    endif.
    Regards,
    Rich Heilman

  • After reports running in background job need to get automatically open in excel sheet

    Dear All,
    I have a requirement which is new to me ,
    Once the user runs the report in background  system is displaying the output in HTML format .... But the Users needs to open in Excel sheet .
    kindly  do the needful
    Regards
    Srikanth BG

    Hi Srikanth,
    Excel processing in background is currently not possible using standard ways. There exist a really good external library that allows you to handle Excel files, and even create them in background. So you could create a final, ready to use Excel file from your background run that can then be opened.
    You might have a look at the library here: http://wiki.scn.sap.com/wiki/display/ABAP/abap2xlsx
    Maybe it helps and suits your needs.
    Cheers,
    Marc

  • Cannot open my excel sheet, the message saying  library not loaded, image not found therefor the icon is showing on the screenrey

    For the first time I cannot open my Excel. The report is saying:image not found, therefor the icon is showing on my desktop.
    Before my Mac open with excel sheet, now it is not there anymore. I guess it it hiding somewhere. How to find it? As you can see I am not an IT . Please try to avoid hight tech wording.
    Many thanks,
    Eva

    Hi Eva,
    Open Console in Utilities & see if there are any clues or repeating messages when trying Excel.

  • How to save data in New Excel Sheet on each time run the VI?

    Hello everyone 
    I am doing my dissertation. In that i have to store the data of load cell in the excel sheet. I have done that.
    Here i have attach the vi , template in which want to save data named My , and output when complete the rn of vi named My Report.
    Now the problem is once i have run the vi , my report is generated but second time when i run the vi the new my report sheet is not generated. and the second problem is i am getting out put as 511, 0,  2.49.  
    I want the when ever i run the vi every time the new excel sheet should be generated and saved with date, time and my report tag. ex. My Report 20/11/13 12:00
    And i want the output 511,2.49,...dont want this 0.
    please hepl me out its urgent
    Attachments:
    COM TO EXCEL WITH EXCEL TOOLKIT.vi ‏44 KB
    MY.xlsx ‏12 KB
    My_Report 1.xlsx ‏12 KB

    You just need to change the settings. Whenever it will write to excel it will display the save as option.
    Then user will confirm the same
    In the excel dispose report.vi passsave change and close report boolean input as TRUE and see
    Kudos are always welcome if you got solution to some extent.
    I need my difficulties because they are necessary to enjoy my success.
    --Ranjeet

  • Storing data in a new excel sheet for each loop count

    I have a data acquisition code that takes data from the oscilloscope and saves it in an excel file.
    The oscilloscope has to take data at different instants(at each loop count). At each instant, the data gets appended to the same excel sheet. I just wanted to know if there is a way so that each time the data gets stored in a new excel sheet......
    If I run the vi again, the data is stored in a new excel sheet. But in a single run of the vi, all the data is always stored in a single excel sheet. Can anyone please help me with this??
    Thanx. 

    i have used write to measurement file.
    An image of a part of the code is attached.
    thanx... 
    Attachments:
    abc.jpg ‏25 KB

  • Need to open the excel sheet in the selection screen

    Hi All,
    my requirement is to upload the data from excel sheet but that excel sheet have mutiple tabs and all individual tab have mutiple records inside. I need to open the excel sheet from selection screen and select dynamically any tab and i need to put all the records into internal table of that paricular tab.
    Please suggest how it can be done.
    <removed_by_moderator>
    Thanks,
    Madhu
    Edited by: Julius Bussche on Oct 21, 2008 11:41 AM

    >
    madhu singh wrote:
    > Thanks for reply but this FM is actually transfer the tha data frrom excel sheet to the internal table. which we can use later before that i need to open the excel sheet on the selection screen.
    it depends on which event do you call the FM. If you call in INITIALIZATION (or LOAD-OF-PROGRAM) than the Excel sheet will be uploaded before the selection screen appears at all. The problem with the above FM is that it will upload the actual tabstrip of the sheet, probably not what you want (and definetly no multiple ways). To upload data form Excel from multiple tabs, you need to code it on your own with the help of OLE commands.

  • Unable to open new google sheets using iphone google drive

    I am unable to open new google sheets using iphone google drive. Please help!

    Me too. Nor in iPhone neither in iPad . Please help!

  • Opening new excel file from available Template-Urgent

    Hi Friends,
    I have the functionality like this. I have one excel template. In that i am getting two text files(header and row values) and filling it on the excel file. After that i am doing operation on it. These things i have succeded already. The problem is i am opening the excel file like this
    Process pro = Runtime.getRuntime().exec(strExcelPath+" "+"..\\std\\app\\client\\resource\\SkillReport.xlt");
    when i am opening like this it is opening the tempalte for editing in stead of getting new instance from it. Can any one help me to get a new instance in stead of opening the template itself.

    Thanks guys. I've found another way of doing the same.

  • How to Convert Report into Excel Sheet when Sending Mail.

    Dear Friends,
    i want to send mail to HOD of Product with an Excel Sheet .
    i want to send Pending Issue details to HOD in Excel Sheet attachment .
    here i have pending issue report now i need to send it in Excel Sheet attachment .
    i have table where i have manage Product ID and HOD OF PRODUCT.
    CREATE TABLE  "MAP_USER_PRODUCT_DTL"
       (     "ID" NUMBER NOT NULL ENABLE,
         "PRODUCT_ID"NUMBER,
         "USER_ID" VARCHAR2(5) NOT NULL ENABLE,
         "HOD_PROD" VARCHAR2(100)========================================Value is Y OR N IF HOD then Y else N
         CONSTRAINT "MAP_USER_PRODUCT_DTL_PK" PRIMARY KEY ("ID") ENABLE
    /i have one more table where all complete issue detail insert.
    CREATE TABLE  "CRM_ISSUE_PROBLEM"
       (     "ID" NUMBER,
         "SUBJECT" VARCHAR2(255) NOT NULL ENABLE,
         "CLIENT_ID" NUMBER,
         "ASSIGNED_TO_ID" VARCHAR2(100),
         "ASSIGNED_ON" DATE,
         "DESCRIPTION" VARCHAR2(4000),
         "PRODUCT_ID" NUMBER NOT NULL ENABLE,
         "STATUS_ID" NUMBER NOT NULL ENABLE,
          CONSTRAINT "CRM_ISSUE_PROBLEM_PK" PRIMARY KEY ("ID") ENABLE
    Here STATUS_ID is Like Pending ISsue,Open Issue and Close Issue .i want to send mail to HOD with Pending Issue Report convert into Excel Sheet and send to HOD?
    How can i do this.
    Thanks
    Edited by: Vedant on Oct 12, 2011 12:36 AM
    Edited by: Vedant on Oct 12, 2011 2:22 AM

    Hello Vedant,
    Would it suffice if you send a CSV file?
    If yes, then see following code.. run the code under APEX > Home > SQL Workshop > SQL Commands
    DECLARE
            ln_id NUMBER;
            lc_clob CLOB;
         lb_blob BLOB;
         li_in PLS_INTEGER := 1;
         li_out PLS_INTEGER := 1;
         li_lang PLS_INTEGER := 0;
         li_warning PLS_INTEGER := 0;
         lv_mail_rcpts VARCHAR2(2000) := '[email protected]';
         lv_mail_from VARCHAR2(100) := '[email protected]';     
           lv_clmn_separator VARCHAR2(1) := ',';
    BEGIN
         -- Build file content as CLOB
      -- Replace with your query
         FOR i IN (select object_id A, object_name B, object_type C, status D, temporary E, generated F, secondary G,namespace H from user_objects where rownum < 10)               
         LOOP
        IF lc_clob IS NULL THEN
          lc_clob := i.A||lv_clmn_separator||i.B||lv_clmn_separator||i.C||lv_clmn_separator||i.D||lv_clmn_separator||i.E||lv_clmn_separator||i.F||lv_clmn_separator||i.G||lv_clmn_separator||i.H;
        ELSE
          lc_clob := lc_clob||CHR(10)||i.A||lv_clmn_separator||i.B||lv_clmn_separator||i.C||lv_clmn_separator||i.D||lv_clmn_separator||i.E||lv_clmn_separator||i.F||lv_clmn_separator||i.G||lv_clmn_separator||i.H;
        END IF;
         END LOOP; 
         -- Convert CLOB to BLOB
         DBMS_LOB.CREATETEMPORARY(lb_blob,TRUE);
         DBMS_LOB.convertToBlob(lb_blob,lc_clob,DBMS_LOB.LOBMAXSIZE,li_in,li_out,DBMS_LOB.DEFAULT_CSID,li_lang,li_warning);
         -- Send mail
         ln_id:= APEX_MAIL.SEND(
           p_to        => lv_mail_rcpts,
                 p_from      => lv_mail_from,
                 p_subj      => 'Subject Goes here',
                 p_body      => 'Body goes here'
           -- add CSV file as attachment
         APEX_MAIL.ADD_ATTACHMENT
           p_mail_id   => ln_id,
           p_attachment => lb_blob,
           p_filename   => 'filename.csv',
           p_mime_type  => 'application/csv'
      -- push mail queue
      APEX_MAIL.PUSH_QUEUE;
         -- empty temporary space
         DBMS_LOB.FREETEMPORARY ( lob_loc =>  lb_blob);       
         COMMIT;
    END;Regards,
    Hari

  • Entries missing in excel sheet when sent as an attachmt in email in ECC6.0

    Hi All,
    When I am sending an email with excel attachment from SAP , email functionality is working fine. But when I try to open excel sheet it is giving a warning that "Incompatible format" and when I click on "OK" button excel sheet is opened bu some entries are missing. This problem is occuring when I am sending email in ECC6.0 whereas in 4.7E it works fine.
    I am using classes to send email. Please let me know if any one has any solution.
    My code is :
    g_text_content is the internal table having data .
    example data in g_text_content : line 1 : col1#col2#col3#....
                                                     line 2:  col1#col2#col3#...
    convert the content from RAW to TXT
      CALL FUNCTION 'SO_RAW_TO_RTF'
        TABLES
          objcont_old = g_text_content
          objcont_new = g_text_content
        EXCEPTIONS
          OTHERS      = 0.
        create the document with attachments
        main document
        APPEND 'Sales Report (Quantity Basis) ' TO g_text.
      WRITE p_date TO wa_line.
      CONCATENATE 'Report Date:' wa_line INTO wa_line SEPARATED BY space.
      APPEND wa_line TO g_text.
      APPEND 'Sent as attachment' TO g_text.
    TRY.
        create the send request
          send_request = cl_bcs=>create_persistent( ).
          IF NOT text[] IS INITIAL.
            document = cl_document_bcs=>create_document(
                                      i_type    = 'RAW'
                                      i_text    = text  "main email text
                                      i_subject = p_subj ).
          ENDIF.
        add text attachment to document
          IF NOT text_content[] IS INITIAL.
            document->add_attachment( i_attachment_type    = 'XLS'
                                  i_attachment_subject = p_subj
                                  i_att_content_text   = text_content ).
          ENDIF.
        add list attachment to document
          IF NOT list_content[] IS INITIAL.
            document->add_attachment( i_attachment_type    = 'ALI'
                               i_attachment_subject = p_subj
                               i_att_content_hex    = list_content ).
          ENDIF.
        add document to send request
          send_request->set_document( document ).
    *email to
        create recipient and add to send request
          IF NOT p_to IS INITIAL.
            LOOP AT p_to.
              recipient = cl_cam_address_bcs=>create_internet_address(
                                                p_to-low ).
              CALL METHOD send_request->add_recipient
                EXPORTING
                  i_recipient = recipient.
            ENDLOOP.
          ENDIF.
    *copy to
        create recipient and add to send request
          IF NOT p_cc IS INITIAL.
            LOOP AT p_cc.
              recipient = cl_cam_address_bcs=>create_internet_address(
                                                p_cc-low ).
              CALL METHOD send_request->add_recipient
                EXPORTING
                  i_recipient = recipient
                  i_copy      = 'X'.
            ENDLOOP.
          ENDIF.
    Blind copy
          IF NOT p_bcc IS INITIAL.
            LOOP AT p_bcc.
              recipient = cl_cam_address_bcs=>create_internet_address(
                                                p_bcc-low ).
              CALL METHOD send_request->add_recipient
                EXPORTING
                  i_recipient  = recipient
                  i_blind_copy = 'X'.
            ENDLOOP.
          ENDIF.
        send
          sent_to_all = send_request->send( i_with_error_screen = 'X' ).
          IF sent_to_all = 'X'.
            MESSAGE s022.
          ENDIF.
          COMMIT WORK.
        CATCH cx_bcs INTO bcs_exception.
          MESSAGE e865 WITH bcs_exception->error_type.
      ENDTRY.
    Thanks,
    Sonali.

    Hi change the below sample as per your requirement.
    <unreadable code removed by moderator>
    Regards
    chitra
    Moderator message: please post only relevant code parts, your posts must contain less than 5000 characters to preserve readable formatting.
    Edited by: Thomas Zloch on Nov 15, 2011 1:03 PM

  • Opening new excel file by righ click produce worksheet name in french

    Hi,
    I am using Office 2010. I have strange problem. All my language setup is English. Though when I create a new excel file using right click options. It does create a new excel file with work sheet  named in French by default. I see following three worksheets:
    Feuil1, Feuil2, Feuil3.
    How can I change this to English name so everytime it creates work sheet names as Sheet1,Sheet2,Sheet3?

    Do you have a language pack installed? I assume your computer language is set to French?
    Maurice

  • Not open new tab (empty) when clicking on a .pdf link that can't be read in FF (no plug-in for pdf)

    When I click on a pdf file that should be able to be open in Firefox (with plug-in), FF open a new empty tab and ask to open or save the file.
    I would like that in case of FF not being able to open the pdf file, it skips the "open empty tab" part and directly go to "open/save" part.
    Is there a way, server side, to tell FF to do so or is there only only client side solution ?
    NB : In case that pdf can be open in FF, or any other browser, it should still be open in the browser and not be asking to "open/save", the point is only the empty tab.

    Is it possible you were using the Tab Mix Plus extension on your Windows system? Tab Mix Plus has a feature to force bookmarks into a new tab automatically when you left-click instead of the default behavior of opening in the same tab.

  • Stop "Open in Dashboard" widget from opening new Safari window when viewed

    Hi,
    For the first time, tried Safari's "open in dashboard" to make a widget showing an area of a webpage that updates information frequently.
    It worked, but now whenever the Dashboard is viewed, something in the code opens up a new Safari window, even starting up Safari first if need be. (Because of the url, I suspect some javascript is trying to set a third-party tracking cookie.) Safari preferences don't appear to matter.
    Any way to prevent this?  2010 iMac/10.6.5/Safari 5.0.3.
    Thanks.

    Thanks for replying, but that isn't the answer I am looking for.  Also, there is no + sign, UNLESS you do tap the overlapping boxes.
    Let me try to ask my question a little more clearly:
    When I tap the two overlapping boxes on the lower left (the option to Open New Windows), the new Window that appears will show your Bookmarked FAVORITES. But with my new iPhone 6, and the new iOS 8.0.2, when I tap the two boxes to open a New Window, my Bookmark Favorites show (as they always have and should), but below them, there is a dividing line underneath them, and it says Recently Viewed Websites, and has these websites available to tap.
    So my question is, HOW DO I TURN THESE OPTION OFF?
    *UPDATE  (10.13.14): Since I have asked this question, I no longer see these Recently Viewed Websites under my Bookmarked Favorites in my new Window tabs. So I hope that Apple fixed it, or somehow it was a mistake, or somehow I changed an Option on my iPhone 6 that stopped this for reoccurring.
    Thank you for your help bobseufert! I appreciate your concern, kindness, and the time to try to help. I am grateful.
    Have a blessed day.

Maybe you are looking for

  • Shake skips frame in sequence

    Hi I'm new to shake, but a vet on final cut. I have a 5 sec video clip that i laid down in a timeline with fcp. At the end of the clip I want it to play in reverse, so i copied the clip, placed it directly after the original and used the modify->spee

  • Why won't my macbook pro charger work

    My macbook pro charger wont work when i plug it in to my laptop the light on it is really dim. And I have plugged it in at 3 different places. And on my laptop it says not charging. Please help!

  • DAC - Run in incremental load

    Can we configure DAC to run only INCREMENTAL LOAD. Usually the first run is always FULL LOAD.

  • Cal alarms tell me events are an hour later

    my ical alarms tell me events are an hour later than actually put into ical. i live +1 hour GMT, but have time zone support on. ideas?

  • Outlook looses connectivity after DAG Failover

    Hi team, Im running a lab environment with 2xCAS (WNLB) and 2xMBX (DAG) servers. Since it's a lab environment I've set the DC as my FSW. All Virtual Directories are pointing to 'mail.contoso.com' pointing to the two CASs which is WNLB'ed. To test the