Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I use Excel solver from VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00762224
Message ID:
00762263
Vues:
16
Solver is an Excel ADD-in. So I believe you need to call it like:
ObjExcel.Application.Run("SOLVEROK", "$C$4",2,"0","$C$4:$C$7")
(though I never used it myself)

Usually Add-ins do not work in VFP without reinstalling. So probably you need to add something like this:

* check what Addins Titles are available
if ObjExcel.Application.Addins.Count<=0
? "Terminating. NO add_ins are available!"
return
endif

lnAddins=0
for ia=1 to ObjExcel.Application.Addins.Count
if "SOLVER" $ upper(ObjExcel.Application.Addins(ia).Title)
lnAddins=ia
EXIT
endif
endfor

if lnAddins=0
? "Terminating. 'SOLVER' addin notavailable!"
return
endif
with ObjExcel.Application.Addins(lnAddins)
.Installed=.f. && remove
.Installed=.t. && add
endwith
...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform