galileogali
Well-known Member
- Joined
- Oct 14, 2005
- Messages
- 748
This is my code (a piece)
Excel from Word.
Without Reference to Excel Enabled
Why do I get an error 438 in this line?
xldown is defined in declarations
Code:
Option Explicit
Sub CargarVariables()
Dim xlp As Object
Dim VAR As Variable
Dim wbk As Object
Dim wks As Object
Dim ActCell As Object
Dim ruta As String
Dim resp As Integer
Const xldown = -4121
Static regist As Variant
ruta = ThisDocument.Path & "\"
On Error Resume Next
Set xlp = GetObject(, "Excel.Application")
Err.Clear
On Error GoTo 0
If xlp Is Nothing Then
Set xlp = CreateObject("Excel.Application")
End If
On Error Resume Next
Set wbk = xlp.Workbooks("Carga .xls")
Err.Clear
On Error GoTo 0
If wbk Is Nothing Then
xlp.Workbooks.Open ruta & "Carga .xls"
Set wbk = xlp.ActiveWorkbook
End If
Set wks = wbk.Sheets("Hoja1")
Set ActCell = wks.Range("A2")
ActCell.Activate
ActCell.End (xldown)
Excel from Word.
Without Reference to Excel Enabled
Why do I get an error 438 in this line?
Code:
ActCell.End (xldown)
xldown is defined in declarations