Modificar archivo excel sin abrir
DAM, en esta oportunidad requiero de tu ayuda como siempre; he obtenido investigando las siguientes macros:
Private Function GetValue(path, file, sheet, ref)
' Retrieves a value from a closed workbook
Dim arg As String
' Make sure the file exists
If Right(path, 1) <> "\" Then path = path & "\"
If Dir(path & file) = "" Then
GetValue = "File Not Found"
Exit Function
End If
' Create the argument
arg = "'" & path & "[" & file & "]" & sheet & "'!" & _
Range(ref).Range("A1").Address(, , xlR1C1)
' Execute an XLM macro
GetValue = ExecuteExcel4Macro(arg)
End Functiony la siguiente:
Sub TestGetValue() p = "c:\XLFiles\Budget" f = "Libro1.xlsm" s = "Registro" a = "A1" MsgBox GetValue(p, f, s, a) End Sub
Por medio de éstos procedimientos obtengo la lectura del contenido de una celda específica, sin abrir el archivo excel.
Lo que necesito de tu ayuda es adaptar las anteriores instrucciones para que igualmente sin abrir el archivo me guarde un dato específico en la celda "ZZ2" de la hoja con nombre "registro" que se encuentra oculta con el evento: "xlSheetveryhidden".
Indispensablemente se debe realizar la tarea "Sin Abrir el libro de excel"
Quedo pendiente de lo que requieras para aclarar cualquier duda y de antemano infinitas
1 Respuesta
Respuesta de Dante Amor
1
