Solved

Open excel,word using Javascript

Posted on 2011-03-22
2
348 Views
Last Modified: 2012-05-11
Hi

I want to open excel,word files which located at my web server from web browser.

I used following code

 <script type="text/javascript">
        function openExcel(strFilePath) {

            openExcelDocPath(strFilePath, false);
        }
        function openExcelDocPath(strLocation, boolReadOnly) {
            var objExcel;
            objExcel = new ActiveXObject("Excel.Application");
            if (objExcel != null) {
                objExcel.Visible = true;
                alert(strLocation);

                objExcel.Workbooks.Open(strLocation, false, false);
                objExcel.UserControl = true
            }
        }
    </script>

which is working but it open in read only mode . i want it in read and write mode.

and above code work for on IE its not work for other browser.

please guide me to solve issue.
0
Comment
Question by:jbajaj
2 Comments
 
LVL 7

Accepted Solution

by:
nbove earned 500 total points
ID: 35191122
Try changing:
objExcel.Workbooks.Open(strLocation, false, false);
to
objExcel.Workbooks.Open(strLocation);
0
 

Author Comment

by:jbajaj
ID: 35196246
No nvobe its still opening in read only mode
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now