English
Forum

If no Excel, then Excel&=ocxCreate("Excel.Application") (=0)?

 

Christof
Neuß
Hi,
really a simple question. but I kann's not nachstellen, I on all Rechnern Excel installs have.

If I a Excel-Application "createn" wants and its no Excel on the computer, is then Excel&=0 ?

can I differently testing, whether Excel present/accessible is?

Merci, greetings and a nice weekend...
 
Win10 16 GB RAM
05/13/11  
 



Since I no Excel installs have would it now for me one Leichtes the To testing -

unfortunately bid You but no Exe on so I now not very white I first employ should. ^^
 
05/13/11  
 




Uwe
''Pascal''
Niemeier
Hi people!

the went well on my address...


If I a Excel-Application "createn" wants and its no Excel on the computer, is then Excel&=0 ?

Definitiv No!
If a ungültige ID indicated becomes, arise always one WebBrowser-Window: so joined is then a Message a Verbindungs- or Navigationsfehler.

an Possibility, in order to clarify, whether The desired application present is:
CompileMarkSeparation
window 600,600
declare a#:dim a#,255
declare b#:dim b#,16
declare Error&
stringw a#,0 ="Irgendeine.Application"
Error&=external("ole32","CLSIDFromProgID",a#,b#)
print Error&,winerror$(Error&)
stringw a#,0 ="Excel.Application"
Error&=external("ole32","CLSIDFromProgID",a#,b#)
print Error&,winerror$(Error&)
stringw a#,0 ="InternetExplorer.Application"
Error&=external("ole32","CLSIDFromProgID",a#,b#)
print Error&,winerror$(Error&)
05/13/11  
 




Christof
Neuß
Hello Pascal,

the sees well from

only another question:
I teste the at the beginning of my Program. If %Error<>0 comes a Error Message and Program ends. otherwise geht's hold moreover...
on different to put becomes then Excel opened and again closed. moreover use I ocxCreate(...
How can I because The Application again terminate, The I with your Vorgehensweise opened have. otherwise disturbing The hereafter and remaining even too to end the program open.

thanks
 
Win10 16 GB RAM
05/13/11  
 




Christof
Neuß
I faith, I hab's hinbekommen. About The oxcInfo3a.inc. though has me XPSE one Error gemeldet. The function "WideToMulti..." would not declared. have these then from the ocx2.inc into ocx3a.inc copies. then ging's. with
ExcelTEST&=oxcCreate("Excel.Applikation")
shows me
oxcName(ExcelTEST&)
now "_Application" on.

whether the right is??? i'm invaded, I Excel of my Netbook banished have. means there tested.
there comes "IEWebBrowser2".
The request can means m.E. on

Instr("_APPLICATION",Upper$(osxName(ExcelTEST&)))=0 lauten.
 
Win10 16 GB RAM
05/13/11  
 




Uwe
''Pascal''
Niemeier
Hi Christof!


How can I because The Application again terminate, The I with your Vorgehensweise opened have.


on the elegantesten with ocxMethod(Excel&,"Quit")

_Application  as name one Anwendungs-Objektes shining To voices. or even on IWebBrowser2  testing.

SeeYou
Pascal
 
05/14/11  
 




Christof
Neuß
Hi Pascal,

the functions

I make the now so:
CompileMarkSeparation
ocxInit()
VAR ExcelTEST&=ocxCreate("Excel.Application")

ifNOT InStr("BROWSER",Upper$(ocxName(ExcelTEST&)) )=0

    ocxMethod(ExcelTEST&,"Close")
    MessageBox("Excel ist nicht installiert oder kann nicht gestaret werden!"+Chr$(10)+"Programm wird beendet.","Meldung",0)
    ocxRelease(ExcelTEST&)
    ocxDeInit()
    END

else

    ocxMethod(ExcelTEST&,"Quit")

endif

ocxRelease(ExcelTEST&)
ocxDeInit(=s2>)

The Browser closes itself then but not "Quit". with "Close" geht's neither. or must I the none close?

Merci.
 
Win10 16 GB RAM
05/16/11  
 




Uwe
''Pascal''
Niemeier
Hi Christof!

there had to myself first nachgucken

Kurzer look into Taskmanager shows, the one Webbrowser solid ans aufrufende Profan-Program yoked is and itself so too exits, against which a Applikation self-employed (and möglicherweise in the background) weiterlaufen would.

PS: the meets too To, if one the To erzeugenden Objekt one Control allocate würde; a Applikation had nevertheless one own Window, only the WebBrowser would in the Mainwindow visible:
CompileMarkSeparation
usermessages 16'--nur kontrolliert beenden per ENTER in %hwnd
ocxInit()
declare Control&
var ExcelTEST&=ocxCreate("Excelx.Application",%hwnd,10,10,300,300,$50000000,addr(Control&))

if InStr("BROWSER",Upper$(ocxName(ExcelTEST&)))

    ocxMethod(ExcelTEST&,"Navigate","C:\Hinweis.html")
    waitkey

else

    ocxPut(ExcelTEST&,"Visible",1)
    waitkey
    ocxMethod(ExcelTEST&,"Quit")

endif

ocxRelease(ExcelTEST&)
destroywindow(Control&)
ocxDeInit(ss=s2>)

HTH
Pascal
 
05/17/11  
 




Christof
Neuß
Hi Pascal,

THANK YOU!!!
 
Win10 16 GB RAM
05/17/11  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.919 Views

Untitledvor 0 min.
Ingo01/20/20
H.Brill05/30/19
kustg05/14/19
Uwe Lang07/22/16
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie