FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Excel fail when insert OLEObject with Word document
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Excel fail when insert OLEObject with Word document
Posted: Mon Apr 26, 2021 01:40 PM
Hi, as subject.

Code (fw): Select all Collapse
cFull:= "C:\word\document.docx"
oles:= oExcel:ActiveSheet:OLEObjects



1st try:
Code (fw): Select all Collapse
   oles:Add(nil, cFull, .f.,;           // Here fail
                .f., nil, 0, nil,;
                1, 1, 100, 100)


2nd try:
Code (fw): Select all Collapse
   ole:= oles:Add("Word.Document")
   ole:Name:= cFull             // Here Fail





3rd try:
Code (fw): Select all Collapse
   oShapes:= oExcel:ActiveSheet:Shapes

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


Regards
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Excel fail when insert OLEObject with Word document
Posted: Mon Apr 26, 2021 04:11 PM

Examples for test?

Saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: Excel fail when insert OLEObject with Word document
Posted: Mon Apr 26, 2021 07:35 PM
Sample:

Code (fw): Select all Collapse
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)
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Excel fail when insert OLEObject with Word document
Posted: Mon Apr 26, 2021 08:12 PM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: Excel fail when insert OLEObject with Word document
Posted: Mon Apr 26, 2021 11:56 PM

karinha,

No running.

Harbour and VBA, they dancing badly.

thks. Regards

Continue the discussion