sorry - forgot to write subject.
Hi,
I must accomplish this using client-side javascript or if it's not feasible, ASP.
The scenario: There is an Excel file that resides on a server. The worksheet contains two columns: Date and Name.
Eg.
Date Name
11 Nov John Doe
12 Nov Fred Leigh
They can swap dates with another person in the list. There is a hyperlink on a HTML page through which they can open up the file, edit then save it.
The script (Javascript/ASP) I need:
The same HTML page should display the person's name who appears next to today's date.
All I've got so far is opening the Excel Appliation. No workbook is opened either using javascript or ASP. What am I doing wrong?
ASP:
<% @ language="VBscript" %>
<%
Dim objXlApp, objXlSheet
' create the Excel object
Set objXlApp = Server.CreateObject("Excel.Application"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
' open the spreadsheet file
objXlApp.Workbooks.Open "SheriffOnDuty.xls"
' get the worksheet
Set objXlSheet = objXlApp.Worksheets("SheriffOnDuty4"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
' read from the worksheet
Response.Write(objXlSheet.Range("B1"
.Text)
' clean up
Set objXlSheet = Nothing
objXlApp.Workbooks.Close
Set objXlApp = Nothing
%>
With this one I get this error:
Error Type:
Microsoft Excel (0x800A03EC)
'SheriffOnDuty.xls' could not be found. Check the spelling of the file name, and verify that the file location is correct.
If you are trying to open the file from your list of most recently used files on the File menu, make sure that the file
has not been renamed, moved, or deleted.
/lillu/working/openExcel.asp, line 9
Javascript:
<script language="javascript">
function LaunchExcel()
{
var excelApp = new ActiveXObject("Excel.Application"
;
excelApp.Workbooks.Open = "SheriffOnDuty.xls";
excelSheet = excelApp.Worksheets("SheriffOnDuty4"
;
document.write(excelSheet.Range("B1"
.Text);
excelApp.Quit();
excelApp = null;
setTimeout("CollectGarbage()",1);
}
</script>
It launches Excel but the specified file doesn't show up.
Thank you for any help on this.
Lillu
If you want to get a job done, ask a busy person. (Sherry Conway Appel - American writer)
Hi,
I must accomplish this using client-side javascript or if it's not feasible, ASP.
The scenario: There is an Excel file that resides on a server. The worksheet contains two columns: Date and Name.
Eg.
Date Name
11 Nov John Doe
12 Nov Fred Leigh
They can swap dates with another person in the list. There is a hyperlink on a HTML page through which they can open up the file, edit then save it.
The script (Javascript/ASP) I need:
The same HTML page should display the person's name who appears next to today's date.
All I've got so far is opening the Excel Appliation. No workbook is opened either using javascript or ASP. What am I doing wrong?
ASP:
<% @ language="VBscript" %>
<%
Dim objXlApp, objXlSheet
' create the Excel object
Set objXlApp = Server.CreateObject("Excel.Application"
' open the spreadsheet file
objXlApp.Workbooks.Open "SheriffOnDuty.xls"
' get the worksheet
Set objXlSheet = objXlApp.Worksheets("SheriffOnDuty4"
' read from the worksheet
Response.Write(objXlSheet.Range("B1"
' clean up
Set objXlSheet = Nothing
objXlApp.Workbooks.Close
Set objXlApp = Nothing
%>
With this one I get this error:
Error Type:
Microsoft Excel (0x800A03EC)
'SheriffOnDuty.xls' could not be found. Check the spelling of the file name, and verify that the file location is correct.
If you are trying to open the file from your list of most recently used files on the File menu, make sure that the file
has not been renamed, moved, or deleted.
/lillu/working/openExcel.asp, line 9
Javascript:
<script language="javascript">
function LaunchExcel()
{
var excelApp = new ActiveXObject("Excel.Application"
excelApp.Workbooks.Open = "SheriffOnDuty.xls";
excelSheet = excelApp.Worksheets("SheriffOnDuty4"
document.write(excelSheet.Range("B1"
excelApp.Quit();
excelApp = null;
setTimeout("CollectGarbage()",1);
}
</script>
It launches Excel but the specified file doesn't show up.
Thank you for any help on this.
Lillu
If you want to get a job done, ask a busy person. (Sherry Conway Appel - American writer)