Datamation Logo

Miscellaneous: Open a Spreadsheet into Excel from IE

September 23, 2003
Datamation content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More .

Want to share a script? Click here to contribute!

Author: Tim Ackermann

Platform: Windows NT, Windows 2000, Windows XP

Type: VBScript

Use this small snippet of VBScript to automatically open a spreadsheet into Excel from Internet Explorer, instead of having it open directly in Internet Explorer. I’ve been reading online about scripting for a while. Recently I had a client request a simple thing from me.

Problem: Figure out a way to open an Excel spreadsheet in Microsoft Excel from a Web page instead of it opening in Internet Explorer.

After about two hours of searching, I found something at Microsoft that showed me how to complete this with VBScript.

Download the script.
Scroll down to view the script.


How to open a spreadsheet into Excel from Internet Explorer.


============================================================
I'm including two files with this readme:  Excel_Test.htm and test.xls
Excel Test.htm is a working test webpage.
Copy test.xls to c:temp
Double-click on Excel_Test.htm
============================================================
Adapted from Microsoft Knowledge Base Article:
http://support.microsoft.com/support/kb/articles/Q178/2/22.ASP
============================================================

1. Add the following to the webpage in the  section:

============================================================

2. Then add the following to the webpage in the  section:


============================================================

3. Insert the correct path to the Excel file.

============================================================
NOTE:	You don't have to use a url in the above example:
	Ex: OpenWorkbook("serversharefolderfile.xls")
	Ex: OpenWorkbook("g:folderfile.xls")
NOTE2:	You can change "Open Excel File" to anything you want:
	Ex: VALUE="Click Here to open my spreadsheet"

Disclaimer: We hope that the information in these pages is valuable to you. Your use of the information contained in these pages, however, is at your sole risk. All information on these pages is provided “as -is”, without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by me. I shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.

  SEE ALL
APPLICATIONS ARTICLES
 

Subscribe to Data Insider

Learn the latest news and best practices about data science, big data analytics, artificial intelligence, data security, and more.

Datamation Logo

Datamation is the leading industry resource for B2B data professionals and technology buyers. Datamation's focus is on providing insight into the latest trends and innovation in AI, data security, big data, and more, along with in-depth product recommendations and comparisons. More than 1.7M users gain insight and guidance from Datamation every year.

Advertisers

Advertise with TechnologyAdvice on Datamation and our other data and technology-focused platforms.

Advertise with Us

Our Brands


Privacy Policy Terms & Conditions About Contact Advertise California - Do Not Sell My Information

Property of TechnologyAdvice.
© 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.