Hi All,
The following are my codes, but I got error:
"Export error '80010108'
The object invoked has disconnected from its clients.
Any suggestion?
Thanks.
JW
<HTML>
<HEAD><%@ LANGUAGE="VBSCRIPT" %>
<TITLE>Excelface</TITLE>
</HEAD>
<BODY>
<%
dim whichAction
dim myconnection
dim rsPatientInfo
dim connectString
dim sqlString
dim requestPatientID
whichAction = Request.Form("Action"
response.write(whichAction)
' Create Object
Dim ExcelFace
Set ExcelFace = CreateObject("Excel.Sheet"
' show or dont show excel to user, TRUE or FALSE
ExcelFace.Application.Visible = True
connectString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=C:\Inetpub\
set myConnection = Server.CreateObject("ADODB.Connection"
set rsPatientInfo = Server.CreateObject("ADODB.Recordset"
'Set ExcelFace = CreateObject("Excel.Sheet"
' show or dont show excelto user, TRUE or FALSE
ExcelFace.Application.Visible = True
connectString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=C:\Inetpub\
set myConnection = Server.CreateObject("ADODB.Connection"
set rsPatientInfo = Server.CreateObject("ADODB.Recordset"
sqlString = "select * from Patients, Examinations where Patients.PatientID = Examinations.ID"
' open a connection
myConnection.Open connectString
' create a recordset
Set rsPatientInfo = myConnection.Execute(sqlString)
dim counter
counter = 0
with rsPatientInfo
do while not .EOF Or .BOF
ExcelFace.ActiveSheet.Range("F3:K25".Interior.ColorIndex = 6
' Create both the blue eyes
ExcelFace.ActiveSheet.Range("G6:G10".Interior.ColorIndex = 5
ExcelFace.ActiveSheet.Range("J6:J10".Interior.ColorIndex = 5
' Create a purple nose
ExcelFace.ActiveSheet.Range("H13:I18".Interior.ColorIndex = 29
' create a red mouth
ExcelFace.ActiveSheet.Range("G21:J24".Interior.ColorIndex = 3
' Write the text
ExcelFace.ActiveSheet.Cells(counter,1).Value = fields(0)
counter = counter + 1
.MoveNext
LOOP
end with
' Save the the excelsheet to excelface
dim fileName
fileName = inputbox ("Enter File name", "File Name"
ExcelFace.SaveAs fileName ' "c:\excelface.xls"
' Close Excel with the Quit method on the Application object.
ExcelFace.Application.Quit
' Release the object variable.
Set ExcelFace = Nothing
%>
The data is exported to file:
<a href="
<% response.write(fileName) %>
"><% response.write(fileName) %>
' open a connection
myConnection.Open connectString
' create a recordset
Set rsPatientInfo = myConnection.Execute(sqlString)
dim counter
counter = 0
with rsPatientInfo
do while not .EOF Or .BOF
ExcelFace.ActiveSheet.Range("F3:K25".Interior.ColorIndex = 6
' Create both the blue eyes
ExcelFace.ActiveSheet.Range("G6:G10".Interior.ColorIndex = 5
ExcelFace.ActiveSheet.Range("J6:J10".Interior.ColorIndex = 5
' Create a purple nose
ExcelFace.ActiveSheet.Range("H13:I18".Interior.ColorIndex = 29
' create a red mouth
ExcelFace.ActiveSheet.Range("G21:J24".Interior.ColorIndex = 3
' Write the text
ExcelFace.ActiveSheet.Cells(counter,1).Value = fields(0)
counter = counter + 1
.MoveNext
LOOP
end with
' Save the the excelsheet to excelface
dim fileName
fileName = inputbox ("Enter File name", "File Name"
ExcelFace.SaveAs fileName ' "c:\excelface.xls"
' Close Excel with the Quit method on the Application object.
ExcelFace.Application.Quit
' Release the object variable.
Set ExcelFace = Nothing
%>
The data is exported to file:
<a href="
<% response.write(fileName) %>
"><% response.write(fileName) %>
%>
</BODY>
</HTML>
The following are my codes, but I got error:
"Export error '80010108'
The object invoked has disconnected from its clients.
Any suggestion?
Thanks.
JW
<HTML>
<HEAD><%@ LANGUAGE="VBSCRIPT" %>
<TITLE>Excelface</TITLE>
</HEAD>
<BODY>
<%
dim whichAction
dim myconnection
dim rsPatientInfo
dim connectString
dim sqlString
dim requestPatientID
whichAction = Request.Form("Action"
response.write(whichAction)
' Create Object
Dim ExcelFace
Set ExcelFace = CreateObject("Excel.Sheet"
' show or dont show excel to user, TRUE or FALSE
ExcelFace.Application.Visible = True
connectString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=C:\Inetpub\
set myConnection = Server.CreateObject("ADODB.Connection"
set rsPatientInfo = Server.CreateObject("ADODB.Recordset"
'Set ExcelFace = CreateObject("Excel.Sheet"
' show or dont show excelto user, TRUE or FALSE
ExcelFace.Application.Visible = True
connectString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=C:\Inetpub\
set myConnection = Server.CreateObject("ADODB.Connection"
set rsPatientInfo = Server.CreateObject("ADODB.Recordset"
sqlString = "select * from Patients, Examinations where Patients.PatientID = Examinations.ID"
' open a connection
myConnection.Open connectString
' create a recordset
Set rsPatientInfo = myConnection.Execute(sqlString)
dim counter
counter = 0
with rsPatientInfo
do while not .EOF Or .BOF
ExcelFace.ActiveSheet.Range("F3:K25".Interior.ColorIndex = 6
' Create both the blue eyes
ExcelFace.ActiveSheet.Range("G6:G10".Interior.ColorIndex = 5
ExcelFace.ActiveSheet.Range("J6:J10".Interior.ColorIndex = 5
' Create a purple nose
ExcelFace.ActiveSheet.Range("H13:I18".Interior.ColorIndex = 29
' create a red mouth
ExcelFace.ActiveSheet.Range("G21:J24".Interior.ColorIndex = 3
' Write the text
ExcelFace.ActiveSheet.Cells(counter,1).Value = fields(0)
counter = counter + 1
.MoveNext
LOOP
end with
' Save the the excelsheet to excelface
dim fileName
fileName = inputbox ("Enter File name", "File Name"
ExcelFace.SaveAs fileName ' "c:\excelface.xls"
' Close Excel with the Quit method on the Application object.
ExcelFace.Application.Quit
' Release the object variable.
Set ExcelFace = Nothing
%>
The data is exported to file:
<a href="
<% response.write(fileName) %>
"><% response.write(fileName) %>
' open a connection
myConnection.Open connectString
' create a recordset
Set rsPatientInfo = myConnection.Execute(sqlString)
dim counter
counter = 0
with rsPatientInfo
do while not .EOF Or .BOF
ExcelFace.ActiveSheet.Range("F3:K25".Interior.ColorIndex = 6
' Create both the blue eyes
ExcelFace.ActiveSheet.Range("G6:G10".Interior.ColorIndex = 5
ExcelFace.ActiveSheet.Range("J6:J10".Interior.ColorIndex = 5
' Create a purple nose
ExcelFace.ActiveSheet.Range("H13:I18".Interior.ColorIndex = 29
' create a red mouth
ExcelFace.ActiveSheet.Range("G21:J24".Interior.ColorIndex = 3
' Write the text
ExcelFace.ActiveSheet.Cells(counter,1).Value = fields(0)
counter = counter + 1
.MoveNext
LOOP
end with
' Save the the excelsheet to excelface
dim fileName
fileName = inputbox ("Enter File name", "File Name"
ExcelFace.SaveAs fileName ' "c:\excelface.xls"
' Close Excel with the Quit method on the Application object.
ExcelFace.Application.Quit
' Release the object variable.
Set ExcelFace = Nothing
%>
The data is exported to file:
<a href="
<% response.write(fileName) %>
"><% response.write(fileName) %>
%>
</BODY>
</HTML>