Excel fail when insert OLEObject with Word document

Post Reply
hmpaquito
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Excel fail when insert OLEObject with Word document

Post by hmpaquito »

Hi, as subject.

Code: Select all | Expand

cFull:= "C:\word\document.docx"
oles:= oExcel:ActiveSheet:OLEObjects



1st try:

Code: Select all | Expand

  oles:Add(nil, cFull, .f.,;           // Here fail
                .f., nil, 0, nil,;
                1, 1, 100, 100)


2nd try:

Code: Select all | Expand

  ole:= oles:Add("Word.Document")
   ole:Name:= cFull             // Here Fail





3rd try:

Code: Select all | Expand

  oShapes:= oExcel:ActiveSheet:Shapes

   ole:= oShapes:AddOLEObject("Word.Document", cFull, .t.,;    // Here Fail
                        .t., "", 0, "",;
                        350, 60, 40, 40)


Regards
User avatar
karinha
Posts: 7940
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: Excel fail when insert OLEObject with Word document

Post by karinha »

Examples for test?

Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
hmpaquito
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Excel fail when insert OLEObject with Word document

Post by hmpaquito »

Sample:

Code: Select all | Expand

cFullDoc:= "c:\doc\doc.docx"

oExcel:= TOleAuto:New("Excel.Application")
oExcel:WorkBooks:Add()
oExcel:Visible:= .t.

oShapes:= oExcel:ActiveSheet:Shapes

oShapes:AddOLEObject("Word.Document", cFullDoc, .t.,;    // Here Fail
                        .t., "", 0, "",;
                        350, 60, 40, 40)
hmpaquito
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Excel fail when insert OLEObject with Word document

Post by hmpaquito »

karinha,

No running.

Harbour and VBA, they dancing badly.

thks. Regards
Post Reply