OLE error (instead of opening a new tab it is opening a new workbook)

Hi friends
we have a requirement of passing the data from ITAB to excel
the code is hown below
INCLUDE ole2incl.
DATA: excel_object TYPE ole2_object, "EXCEL OBJECT
workbook_list TYPE ole2_object, "LIST OF WORKBOOKS
workbook TYPE ole2_object, "WORKBOOK
cell TYPE ole2_object, "CELL
font TYPE ole2_object, "FONT
activesheet TYPE ole2_object."ACTIVE SHEET
TABLES: pa0002.
DATA row_number TYPE i.
DATA: it_pa0002 LIKE pa0002 OCCURS 10 WITH HEADER LINE.
START-OF-SELECTION.
  SELECT * FROM pa0002 INTO TABLE it_pa0002 UP TO 10 ROWS.
  CREATE OBJECT excel_object 'EXCEL.APPLICATION'.
  SET PROPERTY OF excel_object 'VISIBLE' = 1.
  CALL METHOD OF excel_object 'WORKBOOKS' = workbook_list.
  CALL METHOD OF workbook_list 'ADD' = workbook.
  GET PROPERTY OF excel_object 'ActiveSheet' = activesheet.
  SET PROPERTY OF activesheet 'NAME' = 'EMPLOYEE_RECORD'.
* FILL THE ACTIVE SHEET WITH COLUMN HEADINGS
  PERFORM fill_cell_with_data USING 1 1 1 'Employee Number'.
  PERFORM fill_cell_with_data USING 1 2 1 'First Name'.
  PERFORM fill_cell_with_data USING 1 3 1 'Last Name'.
  PERFORM fill_cell_with_data USING 1 4 1 'Date of Birth'.
  PERFORM fill_cell_with_data USING 1 5 1 'Place of Birth'.
* FILL EMPLOYEE DATA TO ACTIVE EXCEL SHEET
  LOOP AT it_pa0002.
    row_number = sy-tabix + 1.
    PERFORM fill_cell_with_data USING row_number 1 0 it_pa0002-pernr.
    PERFORM fill_cell_with_data USING row_number 2 0 it_pa0002-vorna.
    PERFORM fill_cell_with_data USING row_number 3 0 it_pa0002-nachn.
    PERFORM fill_cell_with_data USING row_number 4 0 it_pa0002-gbdat.
    PERFORM fill_cell_with_data USING row_number 5 0 it_pa0002-gbort.
  ENDLOOP.
*FREE OBJECT EXCEL_OBJECT.
  CALL METHOD OF workbook_list 'ADD' = workbook.
  PERFORM fill_cell_with_data USING 1 1 1 'Employee Number'.
  PERFORM fill_cell_with_data USING 1 2 1 'First Name'.
  PERFORM fill_cell_with_data USING 1 3 1 'Last Name'.
  PERFORM fill_cell_with_data USING 1 4 1 'Date of Birth'.
  PERFORM fill_cell_with_data USING 1 5 1 'Place of Birth'.
* FILL EMPLOYEE DATA TO ACTIVE EXCEL SHEET
  LOOP AT it_pa0002.
    row_number = sy-tabix + 1.
    PERFORM fill_cell_with_data USING row_number 1 0 it_pa0002-pernr.
    PERFORM fill_cell_with_data USING row_number 2 0 it_pa0002-vorna.
    PERFORM fill_cell_with_data USING row_number 3 0 it_pa0002-nachn.
    PERFORM fill_cell_with_data USING row_number 4 0 it_pa0002-gbdat.
    PERFORM fill_cell_with_data USING row_number 5 0 it_pa0002-gbort.
  ENDLOOP.
  FREE OBJECT excel_object.
*&      Form  FILL_CELL_WITH_DATA
*       text
*      -->ROW        text
*      -->COLUMN     text
*      -->BOLD       text
*      -->VAL        text
FORM fill_cell_with_data USING row column bold val.
  CALL METHOD OF excel_object
    'CELLS' = cell
    EXPORTING #1 = row
    #2 = column.
  SET PROPERTY OF cell 'VALUE' = val.
  GET PROPERTY OF cell 'FONT' = font.
  SET PROPERTY OF font 'BOLD' = bold.
ENDFORM.                    "FILL_CELL_WITH_DATA
According to this code , i am populating the same set of values in two tabs
but instead of opening the second tab after filling the first tab
it is opening a new book
please correct me.
with regards
s.janagar

hi santhosh,
the RSOLETT1 is a module pool program
and the program RSDEMO01 is calling once the workbook and filling one tab
and that requirement is been satisfied in my progrm itself
the thingĀ  is i need to populate the second set of loop into another tab of my excel sheet
please correct my code
dont provide me the sample code
because my code is almost correct i guess
a small piece of code needs to be added or changed
cheers
s.janagar
Edited by: Janagar Sundaramoorthy Nadar on May 5, 2009 10:35 AM
Edited by: Janagar Sundaramoorthy Nadar on May 5, 2009 10:35 AM

Similar Messages

  • New tab will not open web page

    *error message when opening firefox= "Could not initialize the application's security component. The most likely cause is problems with files in your application's profile directory. Please check that this directory has no read/write restrictions and your hard disk is not full or close to full. It is recommended that you exit the application and fix the problem. If you continue to use this session, you might see incorrect application behaviour when accessing security features."
    *new tabs do not open web pages
    *plugin container.exe and updater.exe do not open or run

    Create a new profile as a test to check if your current profile is causing the problems.
    See "Basic Troubleshooting: Make a new profile":
    *https://support.mozilla.org/kb/Basic+Troubleshooting#w_8-make-a-new-profile
    If that new profile works then you can transfer some files from the old profile to that new profile, but be careful not to copy corrupted files.
    See:
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
    Remove all rules for Firefox and the plugin-container from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
    See:
    *https://support.mozilla.org/kb/Server+not+found
    *https://support.mozilla.org/kb/Firewalls

  • Why did in the right-click menu the "open in a new tab" and the "open in a new window" -buttons change places? And can you change it back?

    With the Firefox 4 RC, the "open in a new tab" and the "open in a new window" -buttons have changed places. It's quite annoying because I normally do it without even looking at it, but now it always opens in a new window instead of a new tab. Is it possible to change it back? Maybe in your own settings?

    You can use the menu editor extension to rearrange menu items - https://addons.mozilla.org/firefox/addon/menu-editor

  • In FF 34.0.5 I use to be able to click on a link within an e-mail and the link would open in a new tab; it now opens in the same tab; how can i change it back?

    I'm using FF 34.0.5 (I like it). I use to be able to right click on a link, within an e-mail, and the link would open in a new tab. Now when I click on the link it opens in the same tab replacing my e-mail.
    Example - a friend sends me an e-mail containing a link to a web site he thinks I'd like. I click on the link and go to the web site and then go back to the e-mail tab and reply to him. Now, when clicking that link, my e-mail disappears and is replaced by the new site.
    How can I fix this? When this happened once before I was told to change the 'value' for a specific 'preference name' through the about:config page.
    Can anyone help jog my memory?
    Thanks!

    Is this about clicking a link in an external program?
    You can check this pref on the about:config page for external links.
    * browser.link.open_newwindow.override.external (-1)
    If this pref has the default value -1 then browser.link.open_newwindow is used.
    * http://kb.mozillazine.org/browser.link.open_newwindow
    *1: current tab; 2:new window; 3:new tab;
    You can open the <b>about:config</b> page via the location/address bar.
    You can accept the warning and click "I'll be careful" to continue.
    *http://kb.mozillazine.org/about:config

  • I can not figure out how to set-up my home page so that it starts with Goggle, and then evrytime I open a new tab, it too opens with Goggle. TY 4 any help.

    [email protected]

    Firefox has always opened a blank new tab, if it opened to anything else that would be caused by an add-on. Check your add-ons to see if any offer this feature, or if any were disabled when you updated to Firefox 4.
    The NewTabURL add-on can be used to open a page of your choice in new tabs - https://addons.mozilla.org/firefox/addon/newtaburl

  • Firefox won't open new tab, have to open new window for any link.

    New tab won't open both when attempting to do it by clicking on "cross" in the tabbar or from File >> new tab.
    Thanks

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • How different of PDF downloning with open in new Tab or not Open new Tab

    How different of PDF downloning with open in new Tab or not Open new Tab?
    My web site distributes PDF files,
    and user can download the PDF files in my site.
    The problem is I wanna show PDF that download in new tab,
    but pdf only downloaded, not open new tab.
    How to open new tab by downloading a PDF

    How different of PDF downloning with open in new Tab or not Open new Tab?
    My web site distributes PDF files,
    and user can download the PDF files in my site.
    The problem is I wanna show PDF that download in new tab,
    but pdf only downloaded, not open new tab.
    How to open new tab by downloading a PDF

  • When I click on the new tab button, a new tab does not open or when I go to file new tab a new tab will not open either.

    When I click on the new tab button, a new tab does not open or when I go to file new tab a new tab will not open either.

    Un-install the '''''Ask Toolbar''''' until Ask fixes the problem caused by their toolbar.
    *http://support.mozilla.com/en-US/kb/Uninstalling+add-ons
    *http://support.mozilla.com/en-US/kb/Cannot%20uninstall%20an%20add-on

  • New tabs will not open despite installing the add on

    Hey! Have I disabled new tab opening somehow? Have looked throughly through menu bars, also installed the suggested add on (new tabs at the end), but the + button to the right of open tabs won't open a new one, nor will ctrl+t or right click new tab. Can right click a link and open it in a new tab. Been a problem for a few months... about time I sought some advice :)
    Cheers, Katrina

    Try uninstalling the Ask toolbar and it should work again. There is a compatibility issue with the Ask toolbar and Firefox that prevents new tabs from being opened.

  • All of a sudden, new tabs have started opening up (in Firefox) advertising games and other stuff. Any idea's of what is going on here?

    All of a sudden, new tabs have started opening up (in Firefox) advertising games and other stuff. Any idea's of what is going on here?

    Try scanning for malware using the removal tools listed near the bottom of the [[Troubleshoot Firefox issues caused by malware]] article.
    It might also help if you could copy and paste troubleshooting information into your reply. See [[Use the Troubleshooting Information page to help fix Firefox issues]] for details.

  • Tabs in Firefox 7 won't work...I can't open a new tab by clicking on the +.....only way to open a new tab is via the FILE/new tab option

    Tabs in Firefox 7 won't work...I can't open a new tab by clicking on the +.....only way to open a new tab is via the FILE/new tab option...it seems like a lot of the options/buttons are non-pressable??

    This issue can be caused by the Ask<i></i>.com toolbar (Tools > Add-ons > Extensions)
    Your system details show that toolbar in the user agent as AskTbYLC/3.11.3.15590
    See:
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • A new tab doesn't open when I hit the Open New Tab button

    When I click on a new tab, nothing happens. Also when I go to File and click on New Tab, nothing happens.

    Uninstall the Ask toolbar and it should work again. There is a compatibility issue with the Ask toolbar and Firefox that prevents new tabs from being opened.
    There are a couple of places to check for the Ask toolbar:
    * Check the Windows Control panel for the Ask Toolbar - http://about.ask.com/apn/toolbar/docs/default/faq/en/ff/index.html#na4
    * Also check your list of extensions, you may be able to uninstall it from there - https://support.mozilla.com/kb/Uninstalling+add-ons

  • Can't open new tab by going to file/new tab (or CTRL+T or clicking on the new tab field). Only way is to right click on a link and choose open in new tab.

    Can't open new tab by going to file/new tab (or CTRL+T or clicking on the new tab field). Only way is to right click on a link and choose open in new tab.

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * You can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''
    Thank you.

  • I'm using 33.0.1 firefox. When I google I don't want a new tab to be opened unless I rt click and open. How do i change settings?

    I'm using 33.0.1 firefox. When I google I don't want a new tab to be opened unless I rt click and open.
    As far as I remember, I wasn't the case before. Could someone help to change the settings or how do I open the link in that particular page itself rather opening in new tab?
    Thanks

    hello, this is a google setting that you can change at google.com/preferences.

  • When I try to open a new tab by using ctrl+t or by any other method, a new tab won't open. How do I fix this???

    i try to open another tab by using control+t, or by going to fill and pressing new tab, or by clicking the plus sign to add another tab, but none of these work and a new tab won't open.

    Uninstall the '''''Ask Toolbar'''''. It can cause that problem.
    *http://support.mozilla.com/en-US/kb/Uninstalling+add-ons
    *http://support.mozilla.com/en-US/kb/Cannot%20uninstall%20an%20add-on
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

  • When clicking the + tab in the tab bar how do I set new tabs to automatically open my home page

    When clicking the + tab in the tab bar how do I set new tabs to automatically open my home page

    You can do that by using an add-on such as:
    * NewTabURL - https://addons.mozilla.org/firefox/addon/newtaburl
    * New Tab Homepage - https://addons.mozilla.org/firefox/addon/new-tab-homepage
    Another way of opening the home page in a new tab is to middle click on the home button in the navigation toolbar.

Maybe you are looking for