Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Forms to Excel example with webutil

Jordan SchroederAug 25 2006 — edited Dec 25 2007
Hello all,

I am working on an application that uses the OLE_WRITE procedure to output to an excel document. I have used the example to write to Word which works just fine. I am trying to modify the code to work with Excel instead of Word, but I am having issues. When I try to run the form I get the error:

wuo-712 Unable to set Property: Text, exception com.jacob.com.ComFailException: Invoke of Text
Source Microsoft Office Excel
Description: Unable to set the Text property of the Range class

And here is the code I am using:

app := CLIENT_OLE2.CREATE_OBJ('Excel.Application');
if :ole.silent = 'Y'
then
CLIENT_OLE2.SET_PROPERTY(app,'Visible',0);
else
CLIENT_OLE2.SET_PROPERTY(app,'Visible',1);
end if;

docs := CLIENT_OLE2.GET_OBJ_PROPERTY(app, 'Workbooks');
doc := CLIENT_OLE2.INVOKE_OBJ(docs, 'add');

selection := CLIENT_OLE2.GET_OBJ_PROPERTY(app, 'Selection');

-- insert data into new document from long item
CLIENT_OLE2.SET_PROPERTY(selection, 'Text', :ole.oletext);

I'm guessing it has something to do with the 'Text' property, most likely the sheet doesn't now what range to put the data. I am having difficulty finding an example of code out there to manipulate the cell range, so if anyone has any clues they would be greatly appreciated.

Thanks,
Jordan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 22 2008
Added on Aug 25 2006
13 comments
32,431 views