Opening Excel Spreadsheet from ABAP

Hello,
Is there any way to put data from an ABAP program into an existing Excel spreadsheet? I know how to put the data into a new spreadsheet but my users want to put the data into an existing spreadsheet where they have developed macros.
Thanks,
Becky

Hi Becky
Here is a procedure using OLE automation.
DATA gs_excel TYPE ole2_object .
DATA gs_wbooks TYPE ole2_object .
DATA gs_wbook TYPE ole2_object .
DATA gs_application TYPE ole2_object .
CREATE OBJECT gs_excel 'EXCEL.APPLICATION' .
SET PROPERTY OF gs_excel 'Visible' = 1 .
GET PROPERTY OF gs_excel 'Workbooks' = gs_wbooks .
GET PROPERTY OF gs_wbooks 'Application' = gs_application .
*--Opening the existing document
CALL METHOD OF gs_wbooks 'Open' = gs_wbook
     EXPORTING #1 = <file_path_var> .
"*--After this point you can go on processing the sheet
using OLE Automation techniques"
If it is just the template to be stored you can save the template .xls file at the application server each time downloading it to a temporary place to open. Or you can store it at SAP Office templates folder. For SAP Office operations you can inspect "BC_SO_*" masked FMs.
And as a last thing, let me introduce you the SDN forums pointing system: You can assign points to posts you find helpful while solving your question. You can reward points by clicking the yellow star icon at header of each reply post. You can reward;
- one 10 points (solved)
- two 6 points (very helpful answer)
- many 2 points (helpful answer)
Kind Regards...
*--Serdar

Similar Messages

  • Automatically open excel spreadsheets with numbers

    can anyone tell me is it possible to set numbers as the default application to ALWAYS open excel spreadsheets? each time i try to open an excel spreadsheet the computer starts up the trial office software. I then have to cancel and choose "open with" and then set "always open with" numbers.
    Having just converted from Windows, I was able to set certain programs to always handle specific file formats, e.g. .jpg, mpeg, avi so I did not have to choose the program every single time i wanted to open a file.
    thx., same goes for pages ,in lieu of word?

    Select an Excel file and option-select (Right Mouse Button) and select Get "Info". See attachment below to set "Open With."
    Regards,

  • Can no longer open Excel spreadsheets attachments.

    I have recently upgraded to iOS 5 on my iphone4 and 3GS and can no longer open Excel spreadsheets attachments from my Hotmail. They come up as an E (which I think is Evernote). I don't want to use Evernote, I just want to view them as I could before. Even simple spreadsheets come as this annoying E when I try to open them. Everything worked fine before I did the iOS 5 upgrade and went with the cloud. I've no idea how to this happend or how to solve it.
    Can anyone please help?
    Regards
    Pickers120

    Generally if this happens the thing I have found to do is to quit the application and then restart the application by clicking on one of the files (like the ones in your documnets folder), not by starting the application and using the open command. Doing this immediately will usually solve the problem.
    This could also be an indication of some sort of file or disk corruption so I would recommend that you not only check the disk using Disk Utility from the CD but also checking your disk permissions just to be sure. Instructions for doing so can be found in steps one and two here: http://www.thexlab.com/faqs/repairprocess.html
    If the first two steps don't solve the problem then you might as well go to step three, otherwise stop with one and two.
    If you have backups and cannot get the files to open then your only other choice will be to restore from the backup copies. Either way I would make sure that my disk was healthy, by following the above noted steps, before doing the restore, otherwise you may corrupt the restored copy.
    Good Luck and let us know if this helps!!

  • Moving Excel Spreadsheets from Work to Home

    I have had this problem for the past month. The problem is when moving Excel
    spreadsheets from home to work only (1) out of (6) will not open. It says there is not enough memory. The other spreadsheets are larger so I know the allocation is ok. The work computer is an IMac running system 9.2, the home
    computers are a G4 IMac and a G3 IBook. Both of these are running Tiger 10.4.4. These spreadsheets open on both of these Tiger computers.
    I use a 128MB USBDrive for moving files back and forth. One thing I have noticed recently is that when opening at work the Icons say PC. I have a newer version of Excel at home, cannot load that version at work because it is not compatible with system 9.2.
    Help????????

    Hi, klugej -
    I don't use OSX, so can't suggest a method there. However, in OS 9, try highlighting the icon of the drive (click on it once), then select Erase from the Special menu. With luck, that will offer one of the Mac formats (probably Mac OS Standard) as well as MS-DOS.

  • Troubleshooting issues opening Excel spreadsheets

    Platform: SP 2010 service pack 2. Office 2010, windows 7 on user laptop , IE 9 32 bit browser.
    several users started calling recently about problems opening Excel spreadsheets. They are on different SharePoint sites on the same site collection.
    No changes/patches have been made to SharePoint.
    No changes to the site collection features of configuration of which I am aware.
    The site collection is configured that users clicking on a doc library item opens in the application associated with the file type.
    When I, as a farm admin (which I need to do due to permissions), and I click on the Excel documents on person 1's troubled site, they open in Excel as expected.
    When the person reporting the problem clicks on the Excel spreadsheets, he gets one of two behaviors.
    On the first paginated page (documents 1-31) , if he clicks on an Excel document, two instances of the Excel application opens.
    On page 3 (documents 61-90) when he clicks on an Excel document, the excel data appears within the web page itself with a button at the top that says "Open in Excel". When he clicks that, he gets an error box that states
    To open this workbook, your computer must have a version of Microsoft Excel installed and your web browser must support opening files directly from Excel in the browser.
    This of course is interesting since on the first page, clicking on one of the documents uses the version of Excel installed and opens the file directly.
    None of these behavior, of course, can I duplicate.
    And, just to add another confusing item to the list, if this person goes to a different doc library and everything works fine.
    So this does not seem to be related to add-ons (why would add-ons act differently between sites?).
    The sites that I have examined all have the same advanced setting regarding opening the document in the client app rather than the browser.
    I have not yet started the process of having a repair on Office 2010 be broken in a way that on different pages different behaviors occur?

    Well, after the admins performed the repair on Office 2010, the user was able to click on Excel workbooks and have them open as expected.

  • I transferred excell spreadsheet from my old pc to my new mac. I used it last fortnight but now cannot find it. Any Help please.

    I transferred excell spreadsheet from my old pc to my new mac. I used it last fortnight but now cannot find it. Any Help please.
    I have tried Spotlight but to no avail I have an Imac.
    gp140

    The file should still be listed by name under, "Open Recent."

  • Email XLS excel attachment from ABAP

    Hi,
    I am trying to email an excel attachment from ABAP, but when I open in excel, it says not a recognizable format, but when I click OK it does open as a tab-delimited file and look OK.
    Any ideas please?

    Hi,
    Please check this link
    http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm
    aRs

  • Is there a way to open Excell file from the server and display in the UI and save it back on to the

    Hello there,
    Is there a way to open Excell file from the server and display in the UI and save it back on to the server? (like showing xell file as a datagrid - add rows, columns etc.)

    Hi Mike,
    Welcome you to the forum.
    You may try:
    SELECT * FROM MyDBNameHere.dbo.OUSR T0
    Thanks,
    Gordon

  • "An error occurred sending the command to the application" When trying to open excel document from outlook 2007

    Error message "An error occurred sending the command to the application" When trying to open excel document from outlook 2007.
    OS: Windows Server 2008 R2
    If I save the document then it opens fine, messing with default file associations does not resolve this problem, I've googled for ir it and some suggest unticking compatibility mode or "run as admin" for excel application, neither is selected in my case.
    Outlook is configured to run as remote application from remoteApp server, this error is only occurring for one user, for others excel documents open just fine.

    Hi
    Thank you for using
    Microsoft Office for IT Professionals Forums.
    From your description, we can Create a trusted location follow these steps
    Click the Microsoft Office Button , and then click Excel Options.
    Click Trust Center, click Trust Center Settings, and then click
    Trusted Locations.
    If you want to create a trusted location that is not local to your computer, select the Allow trusted locations on my network (not recommended) check
    box.
    Click Add new location.
     IMPORTANT   We recommended that you don't make your entire
    Documents or My Documents folder a trusted location. Doing so creates a larger target for a hacker to potentially exploit and increases your security risk. Create a subfolder within Documents or My Documents, and make only that folder a trusted location.
    In the Path box, type the name of the folder that you want to use as a trusted location, or click Browse to
    locate the folder.
    If you want to include subfolders as trusted locations, select the
    Subfolders of this location are also trusted check box.
    In the Description box, type what you want to describe the purpose of the trusted location.
    Click OK.
    More detailed information you can refer to this link:
    http://office.microsoft.com/en-us/word-help/create-remove-or-change-a-trusted-location-for-your-files-HA010031999.aspx?CTT=1#BM12
    Please take your time to try the suggestions and let me know the results at your earliest convenience. If anything is unclear or if there is anything
    I can do for you, please feel free to let me know.
    Hope that helps.
    Sincerely
    William Zhou CHN
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Getting error while opening Excel document from SharePoint site

    Hello All,
    I am getting following error while opening Excel document from SharePoint site.
    This issue appears when we open Excel document from Windows>> Run using below mentioned command:
    Excel.exe "{File Name}"
    If once I go to Excel back stage and browse for the SharePoint location, then this problem disappears.
    I have a work around for this issue but main problem is that i do not have any work around when i need to open Exel document using Excel COM interop in C#.
    Thanks,
    Amit Bansal
    Amit Bansal http://www.oops4you.blogspot.com/

    Hi Amit Bansal,
    Thanks for posting in MSDN forum.
    This forum is for developers discussing developing issues involve Excel application.
    According to the description, you got an error when you open the document form SharePoint site.
    Based on my understanding, this issue maybe relative to the SharePoint, I would like move it to
    SharePoint 2013 - General Discussions and Questions forum.
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thanks for your understanding.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Opening Excel sheet from server

    Hi I have one requirement to open Excel Sheet.
    The Excel sheet is residing in a directory parallel to WEB-INF. I am using Jboss server in Linux. in UI whenever I click on link I have to open Excel sheet from the server. Before opening Excel sheet I have to fill with some data. i am using JSP/Servlets .
    Can any one help me on this?
    Guru

    this piece of code is just open a xsl file with writing some data on the file
    it may be helpful for u .i am giving only logic.
    import java.util.*;
    import java.io.* ;
    import java.text.* ;
    public class a{
         // Main method
         public static void main (String args[])
              // Stream to write file
              //File file;
              FileWriter fout;
              String TimeStamp;
              try
              // Open an output stream
              Calendar currentdate= Calendar.getInstance();
                   int currmonth=currentdate.get(Calendar.MONTH)+1;
                   String strMonth="";
                   if(currmonth<10)
                        strMonth="0"+currmonth;
                   String wbname="Equifax"+strMonth+currentdate.get(Calendar.YEAR)+".xls";
                   System.out.println(wbname);
              BufferedWriter outfile = new BufferedWriter(new FileWriter(wbname));
                   //file=new File(filename);
                   fout = new FileWriter (wbname);
              // Print a line of text
              TimeStamp = new java.util.Date().toString();
              //String filename1=file.getName();
              outfile.write(" Apply ");
              // Close our output stream
              outfile.close();          
              // Catches any error conditions
              catch (IOException e)
                   System.err.println ("Unable to write to file");
                   System.exit(-1);
    }

  • Can't open Excel files from Sharepoint 2013

    I am having an issue with opening Excel files from SharePoint 2013. If I click on an excel file it comes up with the error below.
    If I click Try again I get the message below also:
    If I try to open Word or PDF files they open correctly in the appropriate client and I have the option of checking them out and editing them. Any ideas why this would only be happening to Excel files?
    Thanks,
    Shaun

    Hi Shaun,
    I understand that the Excel files cannot be opened from SharePoint in Microsoft Excel.
    Can these files be viewed in the browser?
    I recommend to download a copy of the files with issue and then open them in Excel to see if the issue still occurs.
    If above cannot work, I recommend to repair Office.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Ole excel application from abap

    Hi all ,
               I   an calling  one excel application  from abap .  I   don't want to make excel file visible ,  but insted  want to save and close the file , by using method
    saveas for excel application  and later i want to see the file . file name i want to store in a variable .
    eg :
    CALL METHOD OF H_EXCEL 'FILESAVEAS' = RC
    EXPORTING #1 =  filename .
    Can it be possible ?
    regards,
    SA

    hi
    i simpler method will be to use the function modules for this purpose.
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
             PROGRAM_NAME        = SYST-CPROG
             DYNPRO_NUMBER       = SYST-DYNNR
             FIELD_NAME          = ' '
             IMPORTING
               file_name           = file_name .
              lc_filename = file_name.
              CALL FUNCTION 'GUI_DOWNLOAD'
                EXPORTING
                BIN_FILESIZE                    =
                  filename                        = lc_filename
                  filetype                        = 'DAT'
                TABLES
                  data_tab                        = gt_itab.
              IF sy-subrc <> 0.
              MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
    Fn module F4_filename will prompt for the name of the file to be saved  and GUI_DOWNLOAD will save the file.
    gt_itab is the internal table containing the data to be stored in excel.

  • Opening excel docs from email quickly

    Can Numbers automatically open excel docs from email? I always have to save the file and then open the Numbers program, then open file.

    If Numbers is defined as the app opening XL files, a double click in the xls file in Mail opens it in Numbers.
    You may also try to drag the attachment on the Numbers's icon.
    Yvan KOENIG (VALLAURIS, France)  mercredi 9 janvier 2011 15:29:39
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • Can I read changes in an open Excel spreadsheet?

    Can I make changes to an open Excel spreadsheet and have a Vi read the spreadsheet containing the changes?

    There are several examples for working with excel in the example finder (Help>>Find Examples). Here is a recent discussipon about this.
    Try to take over the world!

Maybe you are looking for

  • Upgrading DVD - Add SATA card & Drives -SIMPLE

    I just thought I would pass on my successful upgrading and expansion of my Dual 2.0A G5. I'm not endorsing the following products - just want to identify what worked in my scenario. I bought an internal Pioneer DVR-111D DVD burner (16X and Dual Layer

  • Syncing behaviour/direction of individual content type in iTunes

    Hi fellows. I wish to clarify my understanding of how iTunes sync (overwrite) the individual content type on an iPod. The scenario is: when I sync an iPod with another new library, typically we will be prompted with the warning message, "+this iPod i

  • Reduce steps to save PDF 'Print' of webpages

    I save images of many webpages for my work. However, I count at least 5 key strokes and/or mouse clicks to complete each PDF 'Print': 1) Print, 2) PDF, 3) Save as PDF, 4) name file and select location, 5) Save. How may I reduce the number of steps to

  • Error Java System: unknow error of portal comunication

    Hi All! I get the following error when opening a WAD Template in the WAD Application. <b>"Error Java System: An unknow portal comunication error has ocurred"</b> After accept this error, it opens the template and I can work with it, but when I make c

  • Error code -69 when trying to sync laptop to ipod

    Hey there, I just got my nano (2nd gen) and first time it sync'd just fine. I bought some itunes and set up some podcasts and now everytime (5+) I connect the two I get: Attempting to copy to disk 'My Ipod' failed. An error code occured (-69). I've r