Actualizar hoja de Excel (en ASP / Vbscript clásico)
ntenté buscar un código que actualizara un archivo Excel (XLS) en Classic-ASP, pero no consigo que funcione.
aquí está lo que tengo:
<!--#include file="../adovbs.inc"-->
<%
' Open and Update and then Close The XLS File
Dim objConn
set objConn = Server.CreateObject("ADODB.Connection")
Dim FLConnect
Dim strSQLexcel
' Create the connection string.
FLConnect = "Provider=Microsoft.Jet.OLEDB.4.0 Data Source=" & Server.MapPath("TEST.xls") & "Extended Properties='Excel 8.0;HDR=No'"
' Create the SQL statement.
strSQLexcel= "UPDATE [Sheet1$A1:A1] SET F1='TestValue1'"
set objConn = Server.CreateObject("ADODB.Recordset")
'Set objConn = New ADODB.Connection
' Create and open the Connection object.
objConn.Open FLConnect
' Execute the insert statement.
objConn.Execute strSQLexcel
' Close and destroy the Connection object.
objConn.Close
%>
Pero sigo recibiendo un error que dice: "La conexión no se puede usar para realizar esta operación. Está cerrada o no es válida en este contexto".
Muchas gracias..