Excel fail when insert OLEObject with Word document

Excel fail when insert OLEObject with Word document

Postby hmpaquito » Mon Apr 26, 2021 1:40 pm

Hi, as subject.

Code: Select all  Expand view  RUN
cFull:= "C:\word\document.docx"
oles:= oExcel:ActiveSheet:OLEObjects



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


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





3rd try:
Code: Select all  Expand view  RUN
  oShapes:= oExcel:ActiveSheet:Shapes

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


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

Re: Excel fail when insert OLEObject with Word document

Postby karinha » Mon Apr 26, 2021 4:11 pm

Examples for test?

Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7834
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Excel fail when insert OLEObject with Word document

Postby hmpaquito » Mon Apr 26, 2021 7:35 pm

Sample:

Code: Select all  Expand view  RUN
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

Postby karinha » Mon Apr 26, 2021 8:12 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7834
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Excel fail when insert OLEObject with Word document

Postby hmpaquito » Mon Apr 26, 2021 11:56 pm

karinha,

No running.

Harbour and VBA, they dancing badly.

thks. Regards
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 43 guests