473,405 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Q: check if excel installed

Hello,
I am using this code to display excel in IE.

locFilesPath = "D:\Files\myFile.xls"
If (System.IO.File.Exists(locFilesPath)) Then
Response.Clear()
Response.ContentType = "Application/x-msexcel"
Response.WriteFile(locFilesPath)
Response.End()
End If

This does not work if remote computer does not have MS office installed. I
need to check if excel installed or not just before this code.
How should I do that?
Thanks,
Jim.
Nov 19 '05 #1
4 4425
First, if you are doing this on the server, you may not be able to tell if
the client has Excel installed. Nothing in your code snippet requires Excel
to be installed, but if the browser receives this byte stream, it will
probably prompt the user to save the file to disk.

"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:63**********************************@microsof t.com...
Hello,
I am using this code to display excel in IE.

locFilesPath = "D:\Files\myFile.xls"
If (System.IO.File.Exists(locFilesPath)) Then
Response.Clear()
Response.ContentType = "Application/x-msexcel"
Response.WriteFile(locFilesPath)
Response.End()
End If

This does not work if remote computer does not have MS office installed. I
need to check if excel installed or not just before this code.
How should I do that?
Thanks,
Jim.

Nov 19 '05 #2
yes it is prompting to the user to save. I need to get user see an error
message and not able to save it to the disk. can I do that?

"Peter Rilling" wrote:
First, if you are doing this on the server, you may not be able to tell if
the client has Excel installed. Nothing in your code snippet requires Excel
to be installed, but if the browser receives this byte stream, it will
probably prompt the user to save the file to disk.

"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:63**********************************@microsof t.com...
Hello,
I am using this code to display excel in IE.

locFilesPath = "D:\Files\myFile.xls"
If (System.IO.File.Exists(locFilesPath)) Then
Response.Clear()
Response.ContentType = "Application/x-msexcel"
Response.WriteFile(locFilesPath)
Response.End()
End If

This does not work if remote computer does not have MS office installed. I
need to check if excel installed or not just before this code.
How should I do that?
Thanks,
Jim.


Nov 19 '05 #3
You do not (by default) have the security permissions necessary to determine
if Excel is installed on the client's computer.
You'd need the user to adjust their browser security settings (so you can
try to instantiate Excel via client side script and trap the related error
if it's not installed) or you'd need some kind of a thick client such as an
ActiveX control.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:63**********************************@microsof t.com...
Hello,
I am using this code to display excel in IE.

locFilesPath = "D:\Files\myFile.xls"
If (System.IO.File.Exists(locFilesPath)) Then
Response.Clear()
Response.ContentType = "Application/x-msexcel"
Response.WriteFile(locFilesPath)
Response.End()
End If

This does not work if remote computer does not have MS office installed. I
need to check if excel installed or not just before this code.
How should I do that?
Thanks,
Jim.

Nov 19 '05 #4
Or just put a notice on the screen asking if they have Excel, if they click
no then dont let them download, if they dont and they click yes...user
error.

MattC
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:ue**************@TK2MSFTNGP11.phx.gbl...
You do not (by default) have the security permissions necessary to
determine if Excel is installed on the client's computer.
You'd need the user to adjust their browser security settings (so you can
try to instantiate Excel via client side script and trap the related error
if it's not installed) or you'd need some kind of a thick client such as
an ActiveX control.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:63**********************************@microsof t.com...
Hello,
I am using this code to display excel in IE.

locFilesPath = "D:\Files\myFile.xls"
If (System.IO.File.Exists(locFilesPath)) Then
Response.Clear()
Response.ContentType = "Application/x-msexcel"
Response.WriteFile(locFilesPath)
Response.End()
End If

This does not work if remote computer does not have MS office installed.
I
need to check if excel installed or not just before this code.
How should I do that?
Thanks,
Jim.


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
by: deko | last post by:
I'm trying to create an MSI in VS.NET that will check for installed Office System components - so my MDE will only install if requirements are met. I'm thinking about using VBScript to inspect...
2
by: Maik | last post by:
Hi everybody, I want to automate an Excel97 application using C#. I use the excel8.olb file as COM interface. How can I check the country code of the installed Excel application? I know that there...
7
by: Alain \Mbuna\ | last post by:
Hi everybody. Does anyone know what code I should use to check for the version number of Excel, installed on a computer? Thanks. Alain.
4
by: zacks | last post by:
I have an application that can read an Excel spreadsheet on a computer that doesn't have Excel installed on using the Jet ODBC 4.0 driver. I know need to modify the application to also be able to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.