Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting if Excel is present 1

Status
Not open for further replies.

ineedhelplease

Technical User
Dec 18, 2002
18
US
I have a database that uses Excel's web query feature to grab data from the internet. Some users do not have excel present on their PCs and it causes Access to error out when running some of these functions. Is there an easy way for Access to detect if Excel is present before running any of the functions or subs that use Excel's web query feature?

Thank you for your help.
 
Hi!

Never considered something like that before, but using "standard" code for creating an instance of Excel should provide this information (even though there must be more elegant solutions around):

[tt]dim xl as object
on error resume next
set xl = CreateObject("Excel.Application")
if err.number<>0 then
err.clear
' excel does not exist
else
xl.quit
' excel exists
end if
set xl=nothing[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top