Using VBA for loading Query data into Excel workbook

Hi all.
I want simply load data from BEx query into Excel Wortksheet using VBA because of report formats and footer section at the end of the results.
Any code examples, tutorials, comments, suggestions will be regarded.
thanx in advance,
Gediminas

The difficalty is that I don't know the number of rows report will return. And I need my footer only on LAST page of workbook.
Another thing I can't imagine how to do by using standart BEx functionality is to design complex column header set (merged columns, sub-columns and etc.).

Similar Messages

  • Load Table Data into Excel Specific range

    Hi,
    I am working with Excel Destination in SSIS, where i have to insert table data into multiple excel sheets with specific range, sheet name same as table name and i should load each table into that particular sheet name in excel.
    So Sheet name will decide at run time and i have created one variable to pass complete sheet name (like [DimAge$A16:R1000]) in excel destination, but it is throwing error Here i am facing two complexities
    1)Getting error while passing excel sheet name as variable
    2) How to insert into excel in specific range of values shown as above.
    Ur help in solving this would be appreciated

    Hi Naveen,
    Based on my research, a worksheet or range is the equivalent of a table or view in Excel. The lists of available tables in the Excel Source and Destination editors display only existing worksheets (identified by the $ sign appended to the worksheet name,
    such as Sheet1$) and named ranges (identified by the absence of the $ sign, such as MyRange).
    So when you use a variable with [DimAge$A16:R1000] or [Select * from DimAge!A$16:R$1000] value in the Excel Destination, the value acts as a worksheet or range name. But there is no such worksheet or range in the excel file, so the error message occurs.
    To fix this issue, please select the cell range in your excel sheet, then right-click the range to define a name for the range to create some ranges with the specific ranges in excel file, then in the "Name of the Excel Sheet" drop down box of
    "Excel Destination Editor" you can see that Named range. Then simply select the range from the drop-down list or use a variable with the range name as the Excel Destination.
    For more information about how to import data to Excel sheet's specific region, please refer to the following blog:
    http://getsetsql.blogspot.in/2012/01/using-ssis-load-data-to-excel-sheet-at.html
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • Unable to use sqlloader to load large data into a varchar2 column..plz.help

    Hi,
    Currently the column in the database is a varchar2(4000) coulmn that stores data in the form of xml and data that has many carrriage returns.
    Current I am trying to archive this column value and later truncate the data in this column.
    I was able to create a .csv file but when using the sqlloder ,the utility fails as the data I am about to load has data stored both in the form of "xml" sometimes and sometimes as a list of attributes separated by newline character.
    After several failed attempts... I would like to know if it can be achieved using sqlloader or if sqlloader is a bad choice and i should go for an import/export instead?
    Thanks in advance...
    -Kevin

    Currently the column in the database is a
    varchar2(4000) coulmn that stores data in the form of
    xml and data that has many carrriage returns. Can I ask why your XML data has carriage returns in it? The nature of XML dictates that the structure is defined by the tags. Of course you can have CR's in your actual data between those tags, but if someone is hard coding CR's into the XML to make it look pretty this in not how XML was intended to be used.
    I was able to create a .csv file but when using the
    sqlloder ,the utility fails as the data I am about to
    load has data stored both in the form of "xml"
    sometimes and sometimes as a list of attributes
    separated by newline character.It probably can be (can you provide a sample of data so we can see the structure) but you would probably be best revisiting the code that generates the CSV and ensure that it is output in a simpler format.

  • Long runtime for loading PCA data into PCA ODS

    hi all,
    hope you can help me regarding this problem:
    i have been trying to load the PCA ODS (standard) from R/3 but it is taking too long so i tried to limit the size by using key fields but no luck. i have tried to load to PSA even that is taking long for around 53440 records i am unable to figure out the problem, i have checked all the transfer rules and update rules every thing is fine.
    can anyone please help me
    thanx a lot in advance

    Hi there,
    don't know if you're loading line items, but following recommendation from SAP shortened our delta loads from 1.5 - 2 hours down to 2 minutes:
    To optimize the performance of data procurement when DataSource 0EC_PCA_3 accesses line item table GLPCA in the OLTP, you should set up an additional secondary index. This should contain the following fields:
    ·         RCLNT
    ·         CPUDT
    ·         CPUTM
    Kind regards
    /martin

  • Some problem of download BSP data into excel using  cl_bsp_utility= download

    Hello Experts,
    I have read the blog of thomas.jung for download bsp data into excel, and it's working correct, and after some try and error, now I can download the excel with multi sheets.It's all cool except one thing.....when I add a button on the standard screen of the supplier qualification of the slc to download the excel file, after the popinp up screen, the standard screen can't do any operation at all......there are no any error message and the downloaded file is all correct .
    Does any one know what can I do?

    any ideas?
    By the way, after some research, maybe the issue was caused by the setup of the button, but I don't know how to fix it...0rz
    the standard code for buttton is
    lv_id = mv_id && '>display'.
    lo_edit_display_button = cl_thtmlb_button=>factory( id       = lv_id
                                                       text     = lv_button_text
                                                   tooltip  = lv_button_text
                                                   enabled  = 'TRUE'
                                                  onclick  = lv_button_action ).
    WHILE io_page_context->element_process( element = lo_edit_display_button ) = if_bsp_element=>co_element_continue.
    ENDWHILE.
    so I copy it and modify like this:
    lv_id = mv_id && '>download'.
        lo_download_excel_button = cl_thtmlb_button=>factory( id       = lv_id
                                                            text     = w_text
                                                        tooltip  = w_text
                                                        enabled  = 'TRUE'
        onclick  = /srmsm/if_ql_ext_ui_c=>ZC_ACTION_DOWNLOAD_EXCEL
    WHILE io_page_context->element_process( element = lo_download_excel_button ) = if_bsp_element=>co_element_continue.
    ENDWHILE.

  • Option to load XML data into BI 70

    Hi All,
    I have read some postings on forums and also have read the "HOW TO load XML data in BW" guide. I am confused when I read the SAP online help documentation for loading XML data .
    Question : Out of the 3 options listed below which option is best suited for loading XML data into BW . XML file is going to be provided by 3rd party company ?
    Thanks and appreciate any input .
    Smith .
    Here is what I found for BI 70 EHP1 help :
    http://help.sap.com/saphelp_nw04s/helpdata/en/b2/e50138fede083de10000009b38f8cf/frameset.htm
    Data is generally transferred into SAP BW by means of a data request, which is sent from SAP BW to the source system (pull from the scheduler). You can also send the data to SAP BW from outside the system. This is a data push into SAP BW.
    A data push is possible for various scenarios:
    ●     Transferring Data Using the SOAP Service SAP Web AS
    ●     Transferring Data Using Web Services
    ●     Transferring Data Using SAP XI
    In all three scenarios, data transfer takes place using transfer mechanisms that are sufficient for Simple Object Access Protocol (SOAP); the data transfer is also XML-based.
    The SOAP-based transfer of data is only possible for flat structures. You cannot transfer hierarchy data.

    Hi,
    I feel you can go with 2nd option. But still wait for some more inputs from Experts........
    Regards,
    Suman

  • ASCP Test for Load Legacy Data

    Through to the legacy Web Adi ASCP Data in the Test of the load.
    Plan to check more than one, but the result is not correct  that there is  cause msc_operation_components not exists.
    Questions 1: msc_operation_components Table also through the Upload Web Adi BOM_Component and Routing_operation Data should be used or whether the Pre-Process Monitor Program or other Concurrent Program please tell us what is produced?
    Questions 2: If you create a Data Collect flat file data self service if you need through the OA Template Upload for msc_operation_components Dat there is no there, what should I do??

    I think you'll find the white paper published on metalink, our main avenue for publishing documentation and providing support information to customers.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by JohnWorthington:
    Hello,
    The 11.0.2 implementation doc mentions a technical "White Paper about the Data Pump" for loading legacy data into HRMS.
    I cannot find this White Paper anywhere.
    Does it exist?
    What is the easiest way to load our legacy data into 11.0.3 HRMS??
    Thanks,
    John Worthington
    [email protected]<HR></BLOCKQUOTE>
    null

  • Taglib to export data into excel?

    Has anyone used a taglib to export data into excel, I have seen one post but when I went to the web site @http://www.servletsuite.com/servlets/exceltag.htm
    It only has the jar file and .tld file is invalid.
    When I just give the jar file, it complains that it can not find the .tld file, so I was wondering if anyone here has some knowledge about this?
    Thanks a lot for your help!

    The displaytag library can do excel exports.
    http://displaytag.sourceforge.net/11/

  • How  to load the data from excel  file  into table in oracle using UTL_FI

    How to load the data from excel file into table in oracle
    and from table to excel file
    using UTL_FILE package
    Please give me some example

    This is something i tried in oracle apex
    http://avdeo.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
    Regards,
    CKLP

  • How to Load the data from excel file(Extension is .CSV) into the temp.table

    Hi
    How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
    My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
    Kindly Suggest the Solution.
    Regards,
    Sachin

    Hello Sachin,
    You can use the following metalink note:How to Read Data from an EXCEL Spreadsheet into a Form Using Webutil Client_OLE2 (Doc ID 813535.1) and modify it a little bit.
    Instead of copy values into forms you can save them in your temporary table.
    Kind regards,
    Alex
    If someone's helpful or correct please mark it accordingly.

  • Does SSIS guarantee that it loads the data into SQL Server in the same order as it is in Excel

    Hi,
    We are trying to load several Excel files into SQL Server SSIS and we need to save the data in the database in the same order as it is in Excel..
    My question is, Does SSIS guarantee that it loads the data into SQL Server in the same order as it is in Excel. If so, we will add a sequence to ensure we have the order.
    Please advise.
    Thanks & Regards,
    Dhanumjay

    Thanks for your response.
    If it is one file then we can add an index column, but we have to load hundreds of files.
    How adding an index/key column to the table works unless SSIS picks and loads the data in the table in the same order as it is in Excel?
    Just to explain my question better,
    If excel has three rows  {a,b},{c,d},{e,f}, does SSIS ensure it loads the data in the same order in a table.
    Thanks.

  • Download Smart form data for 6000 Invoice documents into Excel

    Hi,
    Using RSNAST000 program currently we are printing samrtform.
    Instead of printing data in smartform i need to write into excel.
    Please let me know the logic to do this i need to write 6000 smartforms(Invoice documents) data into Excel.
    Thanks
    Bhuvana

    Ask him how he thinks smart forms can be embedded in Excel, and why he wants Excel (for which benefit, for using which functions of Excel?). He has an idea, for sure.
    Technical possibilities of Excel to embed graphical documents are very limited, I mean 2 solutions: either storing the whole document as an image (rather easy), or split the document into pieces of text (into cells) and boxes and images (stored as Excel graphical elements) with a rather bad render (highly complex, I mean unfeasible).
    - If his idea is to embed them as images (PDFs), then show him the result : 50 kb to 500 kb for each smart form = excel of several mega bytes. He will certainly regret. Moreover I don't see the interest.
    On the other way, propose him to store smart forms in a single spool, so he will be able to display (it's then equivalent to preview) all of them at the same time. He'll surely agree that it's the most efficient way.
    Propose him proofs of concepts.

  • How to write a procedure to load the data into a table using xml file as input to the procedure?

    Hi,
    Iam new to the xml,
    can u please anyone help me how to write procedure to load the data into a table using xml as input parameter to a procedure and xml file is as shown below which is input to me.
    <?xml version="1.0"?>
    <DiseaseCodes>
    <Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    <Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    <Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    </DiseaseCodes>.
    Regards,
    vikram.

    here is the your XML parse in 11g :
    select *
      from xmltable('//Entity' passing xmltype
    '<?xml version="1.0"?>
    <DiseaseCodes>
    <Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    <Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    <Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    </DiseaseCodes>
    ') columns
      "dcode" varchar2(4000) path '/Entity/dcode',
      "ddesc" varchar2(4000) path '/Entity/ddesc',
      "reauthflag" varchar2(4000) path '/Entity/reauthflag'
    dcode                                                                            ddesc                                                                            reauthflag
    0                                                                                (I87)Other disorders of veins - postphlebitic syndrome                           0
    0                                                                                (J04)Acute laryngitis and tracheitis                                             0
    0                                                                                (J17*)Pneumonia in other diseases - whooping cough                               0
    SQL>
    Using this parser you can create procedure as
    SQL> create or replace procedure myXMLParse(x clob) as
      2  begin
      3    insert into MyXmlTable
      4      select *
      5        from xmltable('//Entity' passing xmltype(x) columns "dcode"
      6                      varchar2(4000) path '/Entity/dcode',
      7                      "ddesc" varchar2(4000) path '/Entity/ddesc',
      8                      "reauthflag" varchar2(4000) path '/Entity/reauthflag');
      9    commit;
    10  end;
    11 
    12  /
    Procedure created
    SQL>
    SQL>
    SQL> exec myXMLParse('<?xml version="1.0"?><DiseaseCodes><Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity></DiseaseCodes>');
    PL/SQL procedure successfully completed
    SQL> select * from MYXMLTABLE;
    dcode                                                                            ddesc                                                                            reauthflag
    0                                                                                (I87)Other disorders of veins - postphlebitic syndrome                           0
    0                                                                                (J04)Acute laryngitis and tracheitis                                             0
    0                                                                                (J17*)Pneumonia in other diseases - whooping cough                               0
    SQL>
    SQL>
    Ramin Hashimzade

  • How to load the data from excel file into temprory table in Forms 11g?

    Hi
    How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
    My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
    Kindly Suggest the Solution.
    Regards,
    Sachin

    Declare
        v_full_filename         varchar2(500);
        v_server_path           varchar2(2000);
        v_separator             VARCHAR2(1);
        v_filename              VARCHAR2(400);
        filename                VARCHAR2 (100);
        v_stop_load             varchar2 (2000);
        v_rec_error_log         varchar2(4000);
        v_error_log             varchar2(4000);
        ctr                     NUMBER (12);
        cols                    NUMBER (2);
        btn                     number;
        RES                     BOOLEAN;   
        application             ole2.obj_type;
        workbooks               ole2.obj_type;
        workbook                ole2.obj_type;
        worksheets              ole2.obj_type;
        worksheet               ole2.obj_type;
        cell                    ole2.obj_type;
        cellType                ole2.OBJ_TYPE;
        args                    ole2.obj_type;
        PROCEDURE olearg
        IS
        args   ole2.obj_type;
        BEGIN
        args := ole2.create_arglist;
        ole2.add_arg (args, ctr);                                
        ole2.add_arg (args, cols);                                   
        cell := ole2.get_obj_property (worksheet, 'Cells', args);
        ole2.destroy_arglist (args);
        END;
    BEGIN
    v_full_filename := client_get_file_name(directory_name => null
                                     ,file_name      => null
                                     ,file_filter    => 'Excel  files (*.xls)|*.xls|'  
                                                                            ||'Excel  files (*.xlsx)|*.xlsx|'                                                                 
                                     ,message        => 'Choose Excel file'
                                     ,dialog_type    => null
                                     ,select_file    => null
    If v_full_filename is not null Then
    v_separator := WEBUTIL_CLIENTINFO.Get_file_Separator ;
    v_filename := v_separator||v_full_filename ;
    :LOAD_FILE_NAME := substr(v_filename,instr(v_filename,v_separator,-1) + 1);                                
    RES := Webutil_File_Transfer.Client_To_AS(v_full_filename,"server_path"||substr(v_filename,instr(v_filename,v_separator,-1) + 1));     
    --Begin load data from EXCEL
    BEGIN
        filename := v_server_path||substr(v_filename,instr(v_filename,v_separator,-1) + 1); -- to pick the file
        application := ole2.create_obj ('Excel.Application');
        ole2.set_property (application, 'Visible', 'false');
        workbooks := ole2.get_obj_property (application, 'Workbooks');
        args := ole2.create_arglist;
        ole2.add_arg (args, filename); -- file path and name
        workbook := ole2.get_obj_property(workbooks,'Open',args);
        ole2.destroy_arglist (args);
        args := ole2.create_arglist;
        ole2.add_arg (args, 'Sheet1');
        worksheet := ole2.get_obj_property (workbook, 'Worksheets', args);
        ole2.destroy_arglist (args);
        ctr := 2;                                                     --row number
        cols := 1;                                                -- column number
        go_block('xxx');
        FIRST_RECORD;  
        LOOP       
                --Column 1 VALUE --------------------------------------------------------------------
            olearg;
            v_stop_load := ole2.get_char_property (cell, 'Text'); --cell value of the argument
            :item1 := v_stop_load;
            cols := cols + 1;                                                      
              --Column 2 VALUE --------------------------------------------------------------------
            olearg;
            :item2 := ole2.get_char_property (cell, 'Text'); --cell value of the argument
            cols := cols + 1;
            --<and so on>
        ole2.invoke (application, 'Quit');
        ole2.RELEASE_OBJ (cell);
        ole2.RELEASE_OBJ (worksheet);
        ole2.RELEASE_OBJ (worksheets);
        ole2.RELEASE_OBJ (workbook);
        ole2.RELEASE_OBJ (workbooks);
        ole2.RELEASE_OBJ (application);
    END;
    --End load data from EXCELPlease mark it as answered if you helped.

  • Can anyone confirm the date used for pushing the data into AR interface table? Is it abse don Actual ship date or scheduled ship date?

    Can anyone confirm the date used for pushing the data into AR interface table? Is it abse don Actual ship date or scheduled ship date? We are facing a scenario where trx date is lower than the actual ship to which logically sounds incorrect.
    Appreciate any quick response around this.

    Hi,
    Transaction date  will be your autoinvoice master program submission level date (If you haven't setup any logic.
    Please check the program level default date, if user enter old date ststem will pick the same.
    Customer is trying to set the value of the profile OM:Set receivables transaction date as current date for non-shippable lines at the responsiblity level. System does not set the transaction date to current date in ra_interface_lines_all.
    CAUSE
    Customer has used the functionality in R11i. But after the upgrade to R12, the system functions differently than R11i.
    SOLUTION
    1.Ensure that there are no scheduled workflow background process run.
    2.Set the profile "OM: Set Receivables Transaction Date as Current Date for Non-Shippable Lines"  at Responsibility level only as Yes.
    3.Now switch the responsibility to which the profile is set.
    4.Create order for Non-Shippable Lines and progress it to invoicing.
    5.Ensure that the 'workflow background process' concurrent program is run in the same responsibility and this line is considered in it.
    6.Now check if the 'SHIP_DATE_ACTUAL' is populated to ra_interface_lines_all

Maybe you are looking for

  • Error while trying to install Rescue & Recovery 4.3 on Lenovo 3000 N500

    Well, hello to everyone. I hope you can understand this, because my English is not very good. So, let's get to the point. Recently, I tried to install Rescue & Recovery on my Lenovo 3000 N500. But when everything is nearing completion, I get the mess

  • Software requirements

    Hello, We wish to convert our existing HR processes into enterprise services and create process transperancy by modeling the process in BPM. Finally, create the dashboard in visual composer using the enterprise services. This is our vision. I believe

  • Taking clips from itunes movies and putting them into imovie

    I'm doing a school project and making a movie trailer and i need to take clips from a movie on my itunes and put it onto imovie so i can take clips from the movie. HELP PLEASE!!!

  • Multi Track Project (keeps looooooooaaaaddding)

    Hi there, Ok heres my problem. I have a full lenth feature film (1hr 23 min) in Final Cut Pro 5. the picture is fine but now i need to move to audio and get that down and set. I highlight everything in the timeline. GO up to file>send to > soundtrack

  • Trouble dwnloading videos

    I am a new mac user. I am having trouble with web pages and videos downloading fully. I try to download videos on youtube and they won't just stop downloading in the middle of downloading. I try to refresh the page and sometimes that works, but more