PDA

View Full Version : [VBA] Access-Excel


basileus_82
16-12-2011, 12:14
ciao a tutti ho un problemino

sto utilizzando un oggetto excel in access 2007 perchè devo fare un import

la funzione End(xlDown) non mi funziona

ho provato tutte le possibili sintassi di End(xlDown) ma non mi funziona

è un problema di Access ???

riporto un pezzo di codice



.....

Dim xl As Object
Set xl = CreateObject("Excel.Application")

xl.Visible = False

With xl

.Workbooks.Open path_file

With .Workbooks(.Workbooks.Count)

For j = 1 To .Worksheets.Count
WrksheetName = .Worksheets(j).Name
If (j = 1) Then 'Tipologia Oggetti
MsgBox "ultima cella contigua: " & .Worksheets(WrksheetName).Range("A3").End(xlDown).Value
iLastRow = .Worksheets(j).UsedRange.Rows.Count
'iLastRow1 = iLastRow
'.Worksheets(j).Range("B3:B" & iLastRow).UnMerge
.Worksheets(j).Cells.UnMerge
For Each c In .Worksheets(j).Range("B3:B" & iLastRow)
If c.Value = "" Then
c.Value = c.Offset(-1, 0).Value
End If
Next c
End If
Next j

.......