OLE2 Manipulation of embedded Excel object - need assistance

We are struggling to successfully manipulate an OLE2 embedded Excel spreadsheet from within Forms to update the cells driving an Excel chart using data from an Oracle data table.
All code examples we have found deal with opening an existing file based Excel spreadsheet using OLE2 and manipulating that object, but we have found nothing on opening an embedded Excel spreadhsheet object.
Using the GET_INTERFACE_POINTER function passing in the name of the OLE2 item to obtain a handle to the spreadsheet embedded object seems to return a valid value, but referencing this handle in subsequent calls to GET_OBJ_PROPERTY fails.
The documentation suggests that calling the GET_INTERFACE_POINTER function passing in the name of the OLE2 container item that contains the embedded spreadsheet should open the spreadsheet, activate the spreadsheet and return a handle to the spreadsheet. The behavior doesn't suggest this causing us to wonder if the docs are not accurate and we are really getting back a handle only to the OLE2 container and not to the spreadsheet itself. If this theory is true then how does one properly reference the spreadsheet?
Can anyone shed some light preferably in the form of some working code examples of how we can manipulate Excel 'Cell' objects in a Forms OLE2 embedded Excel spreadsheet?
Any assistance is greatly appreciated!
[email protected]

Try to use:
DECLARE
  handle ole2.obj_type;
  MySheet ole2.obj_type;
  appHandle ole2.obj_type;
  ok_verb boolean;
  MyRange ole2.obj_type;
  args ole2.list_type;
  ret_val varchar2(32000);
  row pls_integer:=1;
  col pls_integer:=1;
  new_val varchar2(1000);
  verb_cnt_str varchar2(100);
  verb_cnt pls_integer;
  loop_cntr pls_integer;
  verb_name varchar2(1000);
BEGIN
  select TO_CHAR( sysdate, 'dd.mm.yyyy hh.mi.ss' ) INTO new_val FROM dual;
  -- Open document
  ok_verb:=false;
  verb_cnt_str := Forms_OLE.Get_Verb_Count('OLE1');
  verb_cnt := TO_NUMBER(verb_cnt_str); 
  FOR loop_cntr in 1..verb_cnt
  LOOP   
    verb_name := Forms_OLE.Get_Verb_Name('OLE1',loop_cntr);
    IF   verb_name = 'Open'   -- In English language
         OR verb_name='Nrjp{r|'  -- In Russian language (CP1251)
         THEN
           EXEC_VERB('OLE1',verb_name);
           ok_verb:=true;
    END IF;
  END LOOP;
  -- Check the errors
  IF NOT ok_verb THEN
       Message( 'Can''t found correct VERB');
       return;
  END IF;
  -- Get handle of item. (Who is it ? I don't know. :) )
  handle := forms_ole.get_interface_pointer('OLE1');
  -- Get handle of Excel application
  appHandle := ole2.Get_Obj_Property( handle, 'Application' );
-- If you want, You can hide the Excel application
-- ole2.set_Property( appHandle, 'Visible', 0 );
  -- Get ActiveSheet
  MySheet:=ole2.Get_Obj_Property( handle, 'ActiveSheet' );
  -- Cells(row,col)
  args:=OLE2.CREATE_ARGLIST;
  OLE2.ADD_ARG(args,row);
  OLE2.ADD_ARG(args,col);
  MyRange:= OLE2.GET_OBJ_PROPERTY( MySheet,'Cells',args);
  OLE2.INVOKE (MyRange,'Activate');
  OLE2.DESTROY_ARGLIST(args);
  -- Get the Cell value
  ret_val:=OLE2.GET_CHAR_PROPERTY( MyRange,'Value' );
  -- And modify it (to current date)
  OLE2.SET_PROPERTY( MyRange,'Value', new_val );
  -- Release handle 
  OLE2.RELEASE_OBJ( MyRange );
  OLE2.RELEASE_OBJ( MySheet );
  -- Save document
  -- 1. Set DisplayAlerts property of Excel Application object
  -- to FALSE ( 0=false, 1=true )
  ole2.SET_PROPERTY( appHandle, 'DisplayAlerts', 0 );
  ole2.invoke( appHandle, 'Save' );
  -- Close the Application
  ole2.invoke( appHandle, 'Quit' );
  -- Release handle
  ole2.release_obj( appHandle );
  ole2.release_obj( handle );
  Message( 'prev. value in Cells(1,1)='||ret_val);
  Message( ' ', NO_ACKNOWLEDGE );
END;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Word 2010 - embedded Excel-Object not opening

    Hi!
    All of a sudden, embedded excel-objects (insert -> table -> excel spreadsheat) in word-documents won't open when doubleclicking. Instead, I can see, that Word tries to open it for a second but then the table seems to disappear (blank document).
    When altering the view with alt-F9, I can still see the field-code though.
    {EMBED Excel.Sheet.8 \* MERGEFORMAT \s}
    When I remove the
    \* MERGEFORMAT \s
    the object opens within Word just fine and can be edited. Also, when I rightclick the object and do a "convert to excel worksheet", it opens within word - the field code changes to {EMBED Excel.Sheet.12} when doing the conversion.
    The problem is: The document is an older template and there are hundreds of docs based on that, so changing the template now is no solution (actually, I created a new one that is working, but all the old files are still affected of course).
    Everything was working fine some weeks ago - maybe an Update/SP2-Installation made some unlucky changes...
    I tried disabling Add-Ins in Word/Excel and checked the "Ignore other application" option in Excel without success.
    Any ideas appreciated!
    Best Regards,
    Stefan

    I am trying to involve someone familiar with this topic to further look at this issue. Appreciate your patience.
    Cheers,
    Tony Chen
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please contact
    [email protected]

  • Cannot Edit Embedded Excel SpreadSheets

    There is a user at our company who cannot open Excel 2010 spreadsheets that have been embedded into Word 2010 documents. Sometimes the embedded Excel Spreadsheet will open with a Picture Tools menu ribbon. Other times he gets an error
    message that Excel is not installed on his computer. When other users open the same embedded objects on their computers they do not have any problems. I have replaced his computer but the problem continues with the new computer. I have also logged onto his
    computer with a different user account and I do not have a problem opening the embedded Excel spreadsheets. The user has Administrator rights on his own computer. We all have Windows 7 Enterprise and Office 2010 Professional Plus installed on our computers.
    Thanks in advance for any assistance with this issue.

    Hi,
    Try this:
    ============
    1.      
    Go to Excel.
    2.      
    Click File > Options >
    Advanced, then in the “General” section, remove the tick from “Ignore other applications that use Dynamic Data Exchange (DDE)“.
    For the general troubleshooting, you may refer to:
    Troubleshoot linked objects and embedded objects
    http://office.microsoft.com/en-us/word-help/troubleshoot-linked-objects-and-embedded-objects-HP005189818.aspx
    Best Regards,
    Sally Tang
    TechNet Subscriber Support in forum
    If you have any feedback on our support, please contact
    [email protected]   

  • Embedded Excel table in Word 2013

    I just purchased a new laptop with Window 8 and Office 2013. Previous Word files with embedded Excel tables will open once then refuse to open a second time. I get an error message, "the program used to create this object is Excel. That program
    us either not installed or your computer..." Both Excel and Word work fine on their own. One thread suggested turning off Add-Ins but I'm not sure how to do that... And it did not seem to work for the other person... HELP!

    Hi,
    In regarding of the issue, I recommend we do some tests to narrow down the issue.
    Create a new Word 2013 file and a Excel 2013 file, and insert the Excel file as object in Word to test.
    If it works fine, we need to repair the previous Word files.
    If it does not work fine, please try to start Word 2013 in
    safe mode (Press Win+R > enter Winword.exe /safe). If it works fine, we'd better check the add-ins both of the Word and Excel:
    In Excel/Word go to file>options>add-ins. Then down the bottom select COM Add-ins from the drop down menu and hit go. Uncheck everything hit ok. Close the options menu close Excel.
    After, we also could update all the latest Office 2013 and Windows 8 patches to test.
    Regards,
    George Zhao
    TechNet Community Support

  • Problem with embedded excel spreadsheet in Word document.

    I am having trouble with a word document that has an embedded excel spreadsheet in it.  If you double click on the spreadsheet to edit it, the following error message appears:
    "The program used to create this object is Excel.  That program is not installed on your computer.  To edit this object, you must install a program that can open the object."
    I know that Excel is installed on the PC.  The PC is running Windows XP SP3 x86 and Office Professional Plus 2007.  I have tried editing the spreadsheet on a PC running Windows 7
    Pro x64 with the same version of office and it works just fine.  I cannot find any differences in the setting between the two so I do not know why it works one place but not the other.
    Any ideas?

    If you double click on an Excel file in Windows Explorer, does Excel startup?  If not, right click on such a File and used the Open with item to set Excel as the default program for opening such files.
    If you need to do that, it may also overcome the issue with the embedded worksheet.
    Hope this helps.
    Doug Robbins - Word MVP,
    dkr[atsymbol]mvps[dot]org
    Posted via the Community Bridge
    "Flyguy009" wrote in message news:[email protected]...
    I am having trouble with a word document that has an embedded excel spreadsheet in it.  If you double click on the spreadsheet to edit it, the following error message appears:
    "The program used to create this object is Excel.  That program is not installed on your computer.  To edit this object, you must install a program that can open the object."
    I know that Excel is installed on the PC.  The PC is running Windows XP SP3 x86 and Office Professional Plus 2007.  I have tried editing the spreadsheet on a PC running Windows 7 Pro x64 with the same version of office and it works just fine. 
    I cannot find any differences in the setting between the two so I do not know why it works one place but not the other.
    Any ideas?
    Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org

  • Word doc with embedded Excel spreadsheet

    I have a Word (2010) doc in which I have embedded Excel (2010) spreadsheets.  We cannot open the spreadsheets after I convert the doc to pdf.  Is there a step I'm missing, or is this not possible?  Thanks

    Content of the embedded object in a Microsoft Office application does not come over to PDF.
    Basically PDF, being a completely different file format / technology from the MS applications' format(s)/technology, does not support this feature.
    You can create a PDF from Word that has not embedded objects.
    Now, with the PDF open in Acrobat you can attach the Excel files.
    Be well...

  • Word 2010 with Embedded Excel table becomes oversized for RDP users

    I originally asked this question on the SharePoint Online forums as this was the first time we've seen this issue. Original Post
    Summarized: we have a Word template with embedded Excel table created in SharePoint Online, and when a RDP user opens it, the document correctly opens in the local version of Word 2010 (not Word Online).   When the table is edited, it becomes
    larger to the point you can no longer view the entire table. 
    We have done some testing with Word 2010 outside of RDP and everything works correctly, the embedded Excel table doesn't become oversized and works as expected.  It seems to definitely be an issue with RDP and I've been looking for any assistance
    on resolving this issue.  I recently did some further testing and found that the only time the table becomes oversized and not view-able is when you copy and paste information from an existing 2003 Excel document.  I would think this is the issue,
    but it doesn't happen when working with Word and SharePoint outside of an RDP environment. 
    The template is a .docx file. All RDP users are in a 2008 R2 environment.

    I did some testing over the weekend and the simple answer to your question - Not always.
    I found 2 variables which seem to cause this to happen:
    1) We have 2 TS servers - one with IE 9, which remains to maintain support for a legacy app which will not work with IE 10 or 11, and one with IE 10.
    2) Screen resolution of the client computer - it seemed that systems with video configurations which could not exceed the maximum of 1280x1024 (the same screen resolution as our TS servers) didn't experience the issue.  There were some laptops
    and higher end systems with widescreen monitors, where this was an issue.  They typically didn't have a 1280x1024 option; yet even if they did they would experience the same issue, just not as pronounced.
    It also seems to only occur when a user copies and pastes information from Excel 2010 into the embedded Excel table in Word 2010.  Again, only within RDP.  On those client computers which had the problem, I could perform the same function outside
    of RDP without any problems.  However, this is not an ideal format for the chefs as they will frequently be moving between different systems during the day.

  • Embedded Excel in Word 2003 document Becomes Corrupt when Saved

    We have a Word 2003 document with Embedded Excel sheets in it.  When this document is saved and reopened, you cannot edit the excel tables, you just get the message "document corrupt, no longer available". 
    Detect and Repair doesn't fix it, it seems to make the excel table a picture or object that cannot be edited. 
    What is the fix for this?

    Hi
    This problem may occur if both of the following conditions are true:
    You installed Office XP SP-2 or Office 2000 SP-3.
    You are running one of the following Norton AntiVirus or Norton SystemWorks programs:
    Norton AntiVirus 2003
    Norton AntiVirus 2002
    Norton AntiVirus 2001
    Norton AntiVirus 2000
    Norton SystemWorks 2003
    Norton SystemWorks 2002
    Norton SystemWorks 2001
    Norton SystemWorks 2000
    Note Norton AntiVirus and Norton SystemWorks are supported by Symantec.
    For more information to resolve the issue, refer to the link below:
    http://support.microsoft.com/kb/328613/en-us
    Regards
    Tylor Wang
    TechNet Community Support
    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.

  • Cannot search file content on Word document with embedded Excel table

    Cannot search file content on Word document with embedded Excel table. I have Windows 8.1 64-bit and Office 2010 Professional. Only phrases from within Excel tables are not searchable. I have many Word documents with embedded Excel table.
    I use it for my invoices. Those invoices are converted to pdf to be sent via mail. Searching the same phrases in related pdf files Works fine. And yes, folders are indexed, searching service is active......... For example I can find all invoices that have
    specific address or name, which is located in word document, but cannot find invoices with specific item name or price, being that information is in embedded Excel table. (not linked, embedded). I thought that is a question for Windows forum, but guys directed
    me here on Office forum. To clarify, I do not use Ctrl+F inside some document, but Windows Search in my folders. Probably the same happens in Office 2013.
    Thank you.

    Hi, I have a lot of Word documents (invoices, offers). Main part of those documents is embedded Excel file because it is easier to do mathematics in Excel than in Word. There are columns with description, unit price, quantity, taxes... Now, I need
    to find who bought HP switch 2530-24G last year. I open folder with last year invoices and search "2530". Cannot find any. But if that document was converted to pdf for mail, than I can find that phrase. Windows search does not work for content if the content
    is in embedded file.

  • To read embedded PDF objects in .xlsx file

    Hello,
    We have a requirement to read the embedded PDF objects in excel 2007 file (.xlsx).
    We tried doing this with the ZIP approach and found that the contents of embedded objects are saved in oleObject1.bin.
    Now this .bin file is of compound file binary format and we don't know how to read contents from this file.
    Does any one knows anything about this or is there any other approach to read the pdf.
    Regards,
    Mandeep

    We are able to extract the PDF file data from OleObject1.bin file.
    Below is the code to extract the PDF file.
    DATA: lv_h type xstring,
               lv_object type xstring,
               lv_pdf     type xstring,
               lv_len type i.
    lv_h = '255044462D'.  " where this value is binary representation of '%PDF".
    FIND FIRST OCCURRENCE OF lv_h IN lv_object  IN BYTE MODE MATCH OFFSET lv_len.
    lv_pdf = lv_object+lv_len.
    Now LV_PDF will contain PDF data in XSTRING format.
    Regards,
    Mandeep

  • Convert Word Doc to PDF - font in Excel object is changed

    Hi,
    I have tried to convert a word document to PDF. The document
    has an Excel object embedded. In the PDF file created by
    acrobat.com, the font in Excel object was changed (no longer Times
    News Roman).
    Can someone please contact me and give it a try?
    My email: [email protected]
    Cheers

    Do you know which font it was substituted for? If the entire
    font is not required, the PDF Conversion process will create a
    subset font, and will then change the name of the font (since it is
    not technically the full original font). However the glyphs used in
    the subset font should be identical.

  • Inserting excel object into powerpoint

    I am in BPC for PowerPoint and trying to "Insert BPC for Excel Object"
    It comes back as an empty worksheet. No other worksheet works either.
    The same file works when I insert it into BPC for Word.
    Any suggestions?

    Hello,
    Perhaps I'm misunderstanding your question? Do you want to have a SWF-file, published by Presenter with inserted SWF's created in CP. Because you speak about 'using the Presenter tab', so I suppose you have Adobe Presenter installed. I have inserted quite a lot of CP-SWF's in a PPT, and this works fine (especially after the recent Presenter update), but the result is a SWF-published by Presenter (under the same Presenter tab). You can even choose to control the CP-SWF by its proper playbar or by the playbar of Presenter.
    BTW, a user doesn't need to have CP installed to watch a CP-SWF, only the Flash Player.
    If this is not the answer you expect, please try to explain somewhat more.
    Lilybiri

  • Unable to add reference for Excel Object Library for use within Script Task

    I have a requirement to use a Script Tax that needs to reference the Excel Object Model. There are numerous articles on using this such as
    http://www.databasejournal.com/features/mssql/article.php/3921141/SSIS-Script-Task-and-Microsoft-Office-Automation.htm.
    Simply, I need to add a reference to the Microsoft Excel 12.0 Object Library.
    I have selected this from the Object List on the COM tab and when this adds the reference it states 'The System cannot find the reference specified', even though the referenced file for this Object is C:\Program Files(x86)\Microsoft Office\Office12\Excel.exe
    and this file location exists on my local machine ?

    Please search where "Microsoft.Office.Interop.Excel.dll" exist in your system and try adding the reference.
    If you don't find the dll there then there might be problem while installing.
    To install the PIAs by using the redistributable package
    http://www.microsoft.com/en-us/download/details.aspx?id=3508
    http://www.microsoft.com/en-us/download/details.aspx?id=18346
    Regards, RSingh

  • Embedding excel workbook in another workbook

    Embedding excel workbook in another workbook
    GSKR

    Hi,
    We can Embbed a Excel file to aworkbook.
    In the Excel tab->Click Insert->The Object window will open->Select Create from File tab-> Select the check box Display as Icon->Click Browse and select the file you want to attach->The file will be shown on the worksheet as an icon.
    However, I don't think we can embed an Excel workbook into a workbook. Could you please re-upload the picture? Thank you.
    Wind Zhang
    TechNet Community Support

  • Access 2003 Embedded OLE Object + Acrobat Reader 9.2 error on close?

    This seems to be a known problem without a known solution.
    We have a SQL database backend and an Access 2003 frontend. The Access client displays scanned PDF documents via an embedded OLE Object field.
    Up until recently, we had been using Acrobat Reader 6.0 as the default viewer, but we switched up to 9.2 so that our staff could read external PDFs with security/encryption,etc. When an embedded PDF is viewed now through the Access client, an error is thrown when Acrobat Reader is closed, indicating that an OLE server was not registered, or needed to be re-installed. This did not happen with the Acrobat 6.0 client.
    Is there any automatic behind-the-scenes file updates being performed when Acrobat Reader 9.2 shuts down? It seems like some information is trying to be written (maybe a timestamp?) and is kicking back an error when it can't update the target file.
    Is there a workaround for this? I need the ability to read secured PDFs, but I also don't want my users having to needlessly deal with persistent error messages.

    Disable the protection mode in the preferences of Adobe Reader.

Maybe you are looking for

  • CS5.5 crashes when an effect is dragged

    I have been using Premiere CS5.5.1 without problems until recently. When an effect, (eg cross dissolve or fade to black), is dragged directly onto the timeline, Premiere locks up and cannot be started until the system is re-booted. If any of the efft

  • How to find out where the exe file was installed?

    Hi there, I have the following problem: In my VI, I'm reading a .txt file through the vi "Open Config Data" in which I specify the path of the txt. file and it returns me a refnum that is used to read the file. When I made the installer to this appli

  • BMP Tutorial mistakes

    I finished the Oracle BPM Turorial (10g Realease 3 (10.3.1) january 2009) and I want to report a couple of mistakes in the guide. On page 36 (Creating a Screenflow), step 12 says: In the Proyect Navigator, expand Processes and click Expense Report. T

  • Image navigation bar for ePub Children's book export?

    I'm designing children's picture books in ID for export to ePub. I've seen some such books on my nook (ePub) that have an image navigation bar that pops up at the bottom of the page. Readers can scroll through reduced images of pages quickly on this

  • Smart Albums gone Dumb

    After updating to iPhoto 6, some of my Smart Albums no longer update automatically. I've noticed the problem specifically with Smart Albums that use the rules "roll contains XYZ" or "roll does not contain XYZ" The Smart Albums will only refresh with