ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Urgent questions regarding the code below (https://www.excelbanter.com/excel-programming/279166-urgent-questions-regarding-code-below.html)

Greener

Urgent questions regarding the code below
 
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

Anya

Urgent questions regarding the code below
 
Does this:
Workbooks.Open "FileLocation\FileName.xls", , False
not work? That's the VBA code.


-----Original Message-----
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
.



All times are GMT +1. The time now is 11:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com