Page 1 of 1

Excel fail when insert OLEObject with Word document

Posted: Mon Apr 26, 2021 1:40 pm
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

Re: Excel fail when insert OLEObject with Word document

Posted: Mon Apr 26, 2021 4:11 pm
by karinha
Examples for test?

Saludos.

Re: Excel fail when insert OLEObject with Word document

Posted: Mon Apr 26, 2021 7:35 pm
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)

Re: Excel fail when insert OLEObject with Word document

Posted: Mon Apr 26, 2021 8:12 pm
by karinha

Re: Excel fail when insert OLEObject with Word document

Posted: Mon Apr 26, 2021 11:56 pm
by hmpaquito
karinha,

No running.

Harbour and VBA, they dancing badly.

thks. Regards