G
Greener
Regarding the code below,
1) How to code to make an Excel file open in NON-ReadOnly mode?
2) Is the line "document.write( )" indeed the way in Netscape to open
an Excel file if you pass a http:/ link? If so, why didn't it work?
Are there any other ways to open files in Netscape?
Thx!
Helena
<script language="JavaScript">
var ua = navigator.userAgent.toLowerCase();
// Browsers: Netscape has a lot of impostors
bNN = (ua.indexOf('mozilla') != -1 && ua.indexOf('compatible') == -1
&&ua.indexOf('opera') == -1 && ua.indexOf('hotjava') == -1
&&ua.indexOf('webtv') == -1 && ua.indexOf('spoofer') == -1);
bIE = (ua.indexOf('msie') != -1 && ua.indexOf('opera') == -1);
function openFile(strFile)
{
if(bIE)
{
alert("ie " + strFile); //open files this way
if(typeof ActiveXObject != 'undefined')
{
// new ActiveXObject can be called.
var myApp = new ActiveXObject("Excel.Application");
//alert("here " + myApp);
if (myApp != null)
{
myApp.Visible = true;
//How to code to make an Excel file open in NON-ReadOnly mode?
myApp.Workbooks.Open(strFile);
myApp.Workbooks(strFile).Activate;
}
}
}
else
{
alert("other " + strFile); //opening file another way
// Is the line "document.write( )" indeed the way in Netscape to open
an Excel file if you pass a http:/ link? If so, why didn't it work?
Are there any other ways to open files in Netscape?
document.write("<a href='" + strFile + "' target='_blank'>");
}
}
</script>
Thank you for your expertise!
Helena
1) How to code to make an Excel file open in NON-ReadOnly mode?
2) Is the line "document.write( )" indeed the way in Netscape to open
an Excel file if you pass a http:/ link? If so, why didn't it work?
Are there any other ways to open files in Netscape?
Thx!
Helena
<script language="JavaScript">
var ua = navigator.userAgent.toLowerCase();
// Browsers: Netscape has a lot of impostors
bNN = (ua.indexOf('mozilla') != -1 && ua.indexOf('compatible') == -1
&&ua.indexOf('opera') == -1 && ua.indexOf('hotjava') == -1
&&ua.indexOf('webtv') == -1 && ua.indexOf('spoofer') == -1);
bIE = (ua.indexOf('msie') != -1 && ua.indexOf('opera') == -1);
function openFile(strFile)
{
if(bIE)
{
alert("ie " + strFile); //open files this way
if(typeof ActiveXObject != 'undefined')
{
// new ActiveXObject can be called.
var myApp = new ActiveXObject("Excel.Application");
//alert("here " + myApp);
if (myApp != null)
{
myApp.Visible = true;
//How to code to make an Excel file open in NON-ReadOnly mode?
myApp.Workbooks.Open(strFile);
myApp.Workbooks(strFile).Activate;
}
}
}
else
{
alert("other " + strFile); //opening file another way
// Is the line "document.write( )" indeed the way in Netscape to open
an Excel file if you pass a http:/ link? If so, why didn't it work?
Are there any other ways to open files in Netscape?
document.write("<a href='" + strFile + "' target='_blank'>");
}
}
</script>
Thank you for your expertise!
Helena