Excel Upload With Multiple Worksheets

Friends,
I have requirement wherein I have to read data from an excel file with multiple worksheets. I have gone through some earlier postings but most of them explain about creating an excel file with multiple worksheets (which is right oppsite of what I need to do)
I am trying to understand the concept of OLE and implement it but am finding it tricky!
Please help me out!
Thanks,
Shyam

See this site: AN EASY REFERENCE FOR OLE AUTOMATION by Serder Simsekler.
Best!
Jim

Similar Messages

  • Excel download with multiple worksheets using ABAP webdynpro

    Content of Internal table should to downloaded  to an excel sheet with multiple worksheet.

    Excel doesn't support multiple worksheets with the text tab delimited or any of the other plain text formats.  So if you need multiple worksheets those approaches are out.  Multiple worksheets would only work with the Excel native format or the XML based format.  From ABAP the best approach would be to create the XML Excel format.  Search the forms and wiki has there has been tons of discussion in the mast on the XML Excel format.

  • C# Script to open and read an Excel spreadsheet with multiple worksheets

    Can someone provide me the C# syntax and Edit Script to open an Excel spreadsheet with multiple worksheets and then using the data to create and output a .csv file? The multiple worksheets contain different data elements that I'll need to parse out and then
    store as a .csv file that will then be read to pump data into our SQL Server Database.
    Thanks for your review and am hopeful for a reply.
    PSULionRP

    I think this code originally came from Joel, who comes here quite a bit.  I'm not a C# expert, like Joe is, but I think this is pretty close to what you want.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using Excel = Microsoft.Office.Interop.Excel;
    using Microsoft.Office.Interop.Excel;
    using System.IO;
    namespace WindowsFormsApplication2
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    Main();
    public void Main()
    string filePath = "C:\\Users\\Ryan\\Desktop\\MainExcel.xlsx";
    Microsoft.Office.Interop.Excel.Application xlobj = new Microsoft.Office.Interop.Excel.Application();
    Workbook w = default(Workbook);
    Workbook w1 = default(Workbook);
    Worksheet s = default(Worksheet);
    Worksheet s1 = default(Worksheet);
    Worksheet xlsht = default(Worksheet);
    xlobj.Visible = true;
    int intItem = 1;
    DirectoryInfo dirSrc = new DirectoryInfo(@"C:\Users\Ryan\Desktop\Test_Folder\");
    foreach (FileInfo ChildFile in dirSrc.GetFiles())
    try
    // Renaming the excel sheet
    w = xlobj.Workbooks._Open(ChildFile.FullName,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing);
    w1 = xlobj.Workbooks._Open(filePath,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing);
    //this doesn't make any sense
    //w1 = xlobj.Workbooks.Open(filePath);
    //if (intItem > 3)
    Excel.Worksheet lastSht =
    (Excel.Worksheet)w1.Worksheets[w1.Worksheets.Count];
    xlsht = (Excel.Worksheet)w1.Worksheets.Add(Type.Missing,
    lastSht,
    Type.Missing, Type.Missing);
    s = (Excel.Worksheet)w.Worksheets[1];
    s1 = (Excel.Worksheet)w1.Worksheets[intItem];
    s1.Name = ChildFile.Name;
    // it will copy and paste sheet from one to another with formula
    s.UsedRange.Copy(Type.Missing);
    Excel.Range r = s1.get_Range("A1", Type.Missing);
    r.PasteSpecial(Excel.XlPasteType.xlPasteValues,
    Excel.XlPasteSpecialOperation.xlPasteSpecialOperationNone,
    Type.Missing, Type.Missing);
    s1.UsedRange.Formula = s.UsedRange.Formula;
    // Renaming the excel sheet
    //w.Save();
    w.Close(false, Type.Missing, Type.Missing);
    w1.Close(false, Type.Missing, Type.Missing);
    catch (Exception ex)
    //w.Save();
    w1.Save();
    w.Close(false, Type.Missing, Type.Missing);
    w1.Close(false, Type.Missing, Type.Missing);
    intItem = intItem + 1;
    //Dts.TaskResult = ScriptResults.Success
    Do you need help getting everything into a CSV, or can you take it from here???
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Excel sheet with multiple tabs to be sent as email

    Hi Experts,
    I have a requirement to generate an Excel sheet with multiple tabs to be sent as email to a distribution list.
    Please help if you have any ideas on the same.
    Thanks,
    Preema

    [http://wiki.sdn.sap.com/wiki/display/ABAP/ToGetFieldDetailsSavedinVariantLayout|http://wiki.sdn.sap.com/wiki/display/ABAP/ToGetFieldDetailsSavedinVariantLayout]
    with this we can get the modified field catalog  based on layout variant
    without calling alv output function modules
    Thanks!   SDN.

  • Excel Template with Multiple Sheets

    Hi everyone,
    I need to build Excel template with multiple sheets where each sheet should have at-least one chart.
    Thanks
    Aravind

    Hi
    Could you please explain those ways here.?
    Many Thanks,
    BK

  • Excel upload with listener

    Hi,
    I have enabled excel upload with the listener, and it actually works fine. I get the data into a collection.
    Now what if I want to store the file in the database? It seems that the file is NOT inserted into wwv_flow_files. Also the item that contains the file has no value when the page is submitted with the XLS2COLLECTION button. (If I create another button that also submits the filename is there)..
    So it seems that when this feature is enabled the file is deleted from www_flow_files when page processing starts.

    Hi Martin,
    the feature is undocumented and not officially supported for 1.1, but known to work for Excel files up to the 2003 format. XLSX (2007 onwards) is not implemented.
    Perhaps going through the discussion and examples in {thread:id=2342792} helps you solve your issue.
    -Udo

  • How can i create  excel sheet with multiple tabs using utl file?

    how can i create excel sheet with multiple tabs using utl file?
    any one help me?

    Jaggy,
    I gave you the most suitable answer on your own thread yesterday
    Re: How to Generating Excel workbook with multiple worksheets

  • Export data to excel with multiple worksheet

    Hi all,
    Thanks to Roel, Andy, Scott, and Varad. I could go this far with my first project with APEX :)
    thank you guys !!
    I am left with one last bit (unless the client request more feature). I need to export the database to an excel spreadsheet.
    I have about 5 tables so I need to create 5 worksheet in the excel file.
    Now I have tried OWA_SYLK from Tom (http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:728625409049#PAGETOP)
    it works in my environment, but I just don't know how to create multiple worksheet in one excel file.
    I read on the internet that XML spreadsheet is the answer but how to do that, I don't know.
    Can anyone enlighten me?
    Thanks.
    Joel

    It's easy with free RXLS PL/SQL library :
    Procedure Test_002 is
    wbk RXLS.XLS_WorkBook; -- workBook data structure
    f1 integer; f2 integer; -– two workSheets
    Begin
    RXLS.NewWorkBook (wbk); -- new WorkBook init.
    -- two worksheets creation
    f1 := RXLS.NewSheet (Wbk,'Departments');
    f2 := RXLS.NewSheet (Wbk,'Employees');
    -- Writing into the first WorkSheet data from the first SQL request (DEPT)
    RXLS.SQLtoXLS (xSQL => 'select * from Dept', xSheet => f1, xWbk => wbk, xR => 3, xC=> 2,
    xMaxRows => 100, xMaxCols => 20);
    -- Writing into the second WorkSheet data from the second SQL request (EMP)
    RXLS.SQLtoXLS (xSQL => 'select * from Emp', xSheet => f2, xWbk => wbk, xR => 1, xC => 3,
    xMaxRows => 20, xMaxCols => 10);
    -- Excel Workbook or Open Office document , (MS XML 2003 format)
    RXLS.GenXLS (wbk);
    -- Dowload to IE or FF
    RXLS.Show (wbk);
    end; -- ex 2
    [www.rci-informatique.fr/rxls]

  • Excel upload with header in the first line

    Hi ,
    I have to upload a Excel sheet with data where the first line will be the Header .
    I am using the FM
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          I_LINE_HEADER        = 'X'
          I_TAB_RAW_DATA       = IT_TAB_RAW_DATA
          I_FILENAME           = P_FILE
        TABLES
          I_TAB_CONVERTED_DATA = IT_FS00_C
        EXCEPTIONS
          CONVERSION_FAILED    = 1
          OTHERS               = 2.
    But the data is not getting uploaded in the IT_FS00_c table.
    is there any other way to do it.
    thanks and regards,
    Vikki.

    Use the folllowing coding.....
        CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
             EXPORTING
                  filename                = p_file
                  i_begin_col             = 1
                  i_begin_row             = 2
                  i_end_col               = 7
                  i_end_row               = 9999
             TABLES
                  intern                  = t_alsm_tab
             EXCEPTIONS
                  inconsistent_parameters = 1
                  upload_ole              = 2
                  OTHERS                  = 3.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        SORT t_alsm_tab BY row col.
        LOOP AT t_alsm_tab INTO r_alsm_tab.
          AT END OF row.
            l_append = 'X'.
          ENDAT.
          IF r_alsm_tab-col = 1.
            r_input_tab-kokrs = r_alsm_tab-value.
          ELSEIF r_alsm_tab-col = 2.
            r_input_tab-bukrs = r_alsm_tab-value.
          ELSEIF r_alsm_tab-col = 3.
            r_input_tab-rprctr = r_alsm_tab-value.
          ELSEIF r_alsm_tab-col = 4.
            r_input_tab-pline = r_alsm_tab-value.
          ELSEIF r_alsm_tab-col = 5.
            r_input_tab-sdatst = r_alsm_tab-value.
          ELSEIF r_alsm_tab-col = 6.
            r_input_tab-sdated = r_alsm_tab-value.
          ELSEIF r_alsm_tab-col = 7.
            r_input_tab-kostl = r_alsm_tab-value.
          ENDIF.
          IF l_append = 'X'.
            APPEND r_input_tab TO t_input_tab.
            CLEAR : l_append , r_input_tab.
          ENDIF.
        ENDLOOP.
      ENDIF.

  • Excel Upload with Hidden Column

    Hi Gurus-
    Can you upload Excel file with hidden column and get the function to read values in hidden column? If yes, could you please guide me how?
    I am using ALSM_EXCEL_TO_INTERNAL_TABLE
    Any help will be highly appreciated.
    Thanks in advance!

    Hi,
    Have a look at program RSDEMO01 (available in the controls examples of the workbench). It demonstrates an OLE connection to Excel.
    To know which excel objects, methods and properties to use it is a good idea to use the excel macro recorder - just do what you want your program to do and then translate the resulting VB code to ABAP OLE.
    For the import of the clipboard data you can use CL_GUI_FRONTEND_SERVICES=>CLIPBOARD_IMPORT. In the result table, iirc, there  is one line for each imported line and within the line the cell values are separated by tab. So there is some work left - it might be a good idea t import the data column by column.
    It has been some time when I did this for a former client of me - so unfortunately I do not have the code any more.
    Regards, Gerd Rother

  • How to link Excel Chart with multiple columns dynamically?

    Hi all,
    I have one problem. I have an excel chart which has to read data from multiple columns for it's X-axis values (time stamps) and the same number of values for it's Y-axis from multiple columns. See figure attached.
    Now, you can do this by manually assigning values by holding control key to tell the chart that data from many columns is continued from the first column. i.e, a long data is distributed along may columns. This is done very easily manually.
    Now, how to do it at runtime through LabVIEW 8.0?
    Although, I have done it through labview when there where only two columns, A and B streching up to any length. But, now to save space we are dumping into many columns in the same page and want the chart plot that data as we dump it. 
    It is tough since I don't know how to assign SourceData of the chart through labview.
    I have attached chart's SourceData picture.
    Hope you all can solve my problem.
    The Y-axis values are: =(good!$B$30:$B$70,good!$D$30:$D$70,good!$F$30:$F$70,good!$H$30:$H$70,good!$B$71:$B$140,good!$D$71:$D$140,good!$F$71:$F$140,good!$H$71:$H$140,good!$B$141:$B$189)
    good is the name of the file.
    The X- axis values are: =(good!$A$30:$A$70,good!$C$30:$C$70,good!$E$30:$E$70,good!$G$30:$G$70,good!$A$71:$A$140,good!$C$71:$C$140,good!$E$71:$E$140,good!$G$71:$G$140,good!$A$141:$A$189)
    See the columns vary from A to F.
    I have still not got what I love.....
    Attachments:
    ExcelChart.JPG ‏113 KB
    SourceData.JPG ‏34 KB
    XY values.JPG ‏36 KB

    Ok i solved the excel chart problem. Here is the figure showing my victory! But offcourse with NI forum help.
    Message Edited by Halemani on 09-19-2008 06:33 AM
    I have still not got what I love.....
    Attachments:
    Chart_XValues_Values.JPG ‏36 KB

  • Mail excel with multple worksheets

    HI,
    I have a requirement to send an excel file with multiple worksheets through e mail. I have seen some of the examples for sending excel with single worksheet, but can anyone please help me to crack this problem of sending an excel with multiple worksheets. Examples i have seen use FM SO_NEW_DOCUMENT_ATT_SEND_API1 but i am not sure how will this work in my case. Any object oriented approch would also be helpful.
    Thanks and regards
    Swapnil

    Hi
    You can generate multiple sheets excel file using the concept of OLE.
    lot of help is available on the same in SDN.
    you can also generate multiple attachments for a single mail for that refer.
       Mail excel with multple worksheets
    Regards
    Renu

  • Excel output (with graphics)

    Hello,
    I am using Oracle reports 10g 1.2.0 version.
    We need to generate oracle reports in Excel format ("real" Excel, not delimited text) with tabular data and
    also graphics.
    I used desformat=spreasheet. But is is giving only one worksheet.
    I've found the "Output to Excel with Oracle9i Reports"
    demo but the Excel template in the demo is very simple and doesn't have graphics.
    Then I've found the following:
    http://otn.oracle.com/products/reports/htdocs/getstart/examples/excel_output/result/excel.jpg
    a) The above site has excel output with multiple worksheets.
    which is similar to what we need but I wasn't able to find related source (excel_emp.jsp).
    b) Using jsp if we can ahieve multiple worksheets with grapahics, please provide us examples.
    c) http://www.oracle.com/technology/products/reports/htdocs/getstart/demonstrations/excel/index.html --This site is not working to find the demo.
    Could you please help me in this?
    Thank you for any help.

    carla,
    the example you mentioned uses the JSP web source that is only available in oracle9i reports.
    in theory you can create any excel output. it is just a matter of creating the template and then adding the reports tags to populate it with data.
    you could then use reports' URL engine to produce files from this output.
    there are certainly ways to do it, but they are only available in oracle9i reports (9.0.2 and higher)
    regards,
    philipp

  • Exporting data from a multiple worksheet excel to oracle database.

    Hi,
    Am having a very big problem,i have to export data from excel to database.My excel is havin multiple worksheet.
    I thought of most of the options nothing is suiting my layout.
    SQL loader ,can't use due to multiple worksheet.
    HSServices can;t use because my column headings are row wise,and the excel start with a big Heading rather than having column headings.
    UTL_FILE can't use beacuse of multiple worksheet,and frankly speaking i don't know how to use utl file with excel to read paticular cell in excel.
    Thanks

    First of all: this is a forum of volunteers.
    So no one is obliged to respond to you.
    Therefore 'urgent' does not exist in this forum, and labeling your request as 'urgent' is considered rude by many. If it is really that urgent, submit a prio 1 request at Metalink.
    Secondly, I don't think you thought of most of the options.
    Yes, you can use SQL*Loader as you can dump each individual worksheet to a separate CSV file.
    Also, you didn't consider ODBC. If ODBC in Excel is too cumbersome, you can use MsAccess to hook the Excel sheet in Msaccess, connect to the database using the Oracle ODBC driver and design an ordinary append query,
    Obviously, you would need one query per worksheet.
    Hth
    Sybrand Bakker
    Senior Oracle DBA

  • Extract program to extract data from SAP into multiple worksheets of excel

    Hi , I am currently facing an issue.
    Extracting the data during data extraction, conversion into an excel and also into multiple worksheets withing a excel file.
    What is the function which can help me. Also how do you give refernce to multiple worksheets to be created withing a excel file (which is the destination)
    Any sample program extracting data from SAP tables into a excel with multiple worksheet will be of immense help
    Please respond. Appreciate it.
    Rgds
    Madhu

    Hi Madhu,
    Here is the program for creating the excel file and creating the multiple worksheets.
    *& Report  ZEXCEL_UPLOAD2
    REPORT  ZEXCEL_UPLOAD2.
    INCLUDE ole2incl.
    DATA: application TYPE ole2_object,
           workbook TYPE ole2_object,
           sheet TYPE ole2_object,
           cells TYPE ole2_object.
    CONSTANTS: row_max TYPE i VALUE 256.
    DATA index TYPE i.
    DATA: BEGIN OF itab1 OCCURS 0, first_name(10), END OF itab1.
    DATA: BEGIN OF itab2 OCCURS 0, last_name(10), END OF itab2.
    DATA: BEGIN OF itab3 OCCURS 0, formula(50), END OF itab3.
    *START-OF-SELECTION
    START-OF-SELECTION.
      APPEND: 'Peter' TO itab1, 'Ivanov' TO itab2,
                                  '=Sheet1!A1 & " " & Sheet2!A1' TO itab3,
                'John' TO itab1, 'Smith' TO itab2,
                                  '=Sheet1!A2 & " " & Sheet2!A2' TO itab3.
      CREATE OBJECT application 'excel.application'.
      SET PROPERTY OF application 'visible' = 0.
      CALL METHOD OF application 'Workbooks' = workbook.
      CALL METHOD OF workbook 'Add'.
    Create first Excel Sheet
      CALL METHOD OF application 'Worksheets' = sheet
                                   EXPORTING #1 = 1.
      CALL METHOD OF sheet 'Activate'.
      SET PROPERTY OF sheet 'Name' = 'Sheet1'.
      LOOP AT itab1.
        index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
        CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
        SET PROPERTY OF cells 'Value' = itab1-first_name.
      ENDLOOP.
    Create second Excel sheet
      CALL METHOD OF application 'Worksheets' = sheet
                                   EXPORTING #1 = 2.
      SET PROPERTY OF sheet 'Name' = 'Sheet2'.
      CALL METHOD OF sheet 'Activate'.
      LOOP AT itab2.
        index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
        CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
        SET PROPERTY OF cells 'Value' = itab2-last_name.
      ENDLOOP.
    Create third Excel sheet
      CALL METHOD OF application 'Worksheets' = sheet
                                   EXPORTING #1 = 3.
      SET PROPERTY OF sheet 'Name' = 'Sheet3'.
      CALL METHOD OF sheet 'Activate'.
      LOOP AT itab3.
        index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
        CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
        SET PROPERTY OF cells 'Formula' = itab3-formula.
        SET PROPERTY OF cells 'Value' = itab3-formula.
      ENDLOOP.
    Save excel speadsheet to particular filename
      CALL METHOD OF sheet 'SaveAs'
                      EXPORTING #1 = 'c:\temp\exceldoc1.xls'     "filename
                                #2 = 1.                          "fileFormat
    Closes excel window, data is lost if not saved
    SET PROPERTY OF application 'visible' = 0.
    **Quick guide to some of the OLE statements for OLE processing in this program as well as a few other ones.
    Save Excel speadsheet to particular filename
    CALL METHOD OF sheet 'SaveAs'
                    EXPORTING #1 = 'C:\Users\dprasad\Desktop\excel_sheet.xls'     "filename
                              #2 = 1.                          "fileFormat
    Save Excel document
    CALL METHOD OF sheet 'SAVE'.
    Quits out of Excel document
    CALL METHOD OF sheet 'QUIT'.
    Closes visible Excel window, data is lost if not saved
    SET PROPERTY OF application 'visible' = 0.

Maybe you are looking for

  • Report Generation: Dynamic VS. Static

    Hi there: I have following questions that I'm not sure how to get clarification. If you have some input, please let me know. You can also email me directly to my email address. I'm looking into a report generation part of this project. One of the req

  • Firefox 4 hangs when attempting to view the Applications tab in Preferences

    Firefox 4 under MacOS X 10.6.6 hangs when I click to select the "Applications" tab on the Preferences dialog. It never paints the pane. When this happens, it consumes 60% CPU. Running dtruss against the running process shows a little activity, but no

  • Asset selections only allowed in repeat run

    Hi Experts, I am was posted Deprication 2009 with 12 periods from Planned posting run. When I am doing Deprication 2010 with 1 periods from Planned posting run for perticual period its work in test run u2018 T E S T R U N completed successfully , A d

  • 11 inch or 13 inch for creative programs? (Adobe CS6, Blender, etc)

    Hello! I currently own a 15 inch Macbook pro and love it, but I have to get a new computer! The reasons why are that my father ('m a teenager, so I still live with my parents) needs a laptop for what he is doing, and because of my horrible, large, an

  • How do I get my 30gig Ipod Vid to get out of restore mode?

    Long story short is that I somehow fried my hd. I put a new one it, it worked perfect. As soon as I connected it to my laptop it restored it and voila, I was off and running. I then tried to use my headphones and realized I forgot to plug in the head