J
jj
Hi, all.
I try to write to Excel from Access 2000 Form.
The Excel locates in network, and the Adp application
locates in local desktop.
I receive an error1004:"Application-defined or object-
defined" while the error stop at [lastRow = Cells.Find
(What:="*", After:=[A1], SearchOrder:=xlByRows,
SearchDirection:=xlPrevious).Row]
Any tips or suggestion is appreciated.
jj
code:
============================================
Dim xlsApp, xlsBook, xlsSheet
CCCfile = GetCCCFile.GetCCCFile("CCCexcel")
Set xlsApp = CreateObject("Excel.Application")
Set xlsBook = xlsApp.Workbooks.Open(CCCfile)
Set xlsSheet = xlsBook.Sheets("Sheet1")
Dim lastACol As Integer
Dim lastBCol As Integer
Dim lastARow As Integer
lastRow = Cells.Find(What:="*", After:=[A1],
SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
lastBCol = Cells.Find(What:="*", After:=[A1],
SearchOrder:=xlByColumns,
SearchDirection:=xlPrevious).Column
I try to write to Excel from Access 2000 Form.
The Excel locates in network, and the Adp application
locates in local desktop.
I receive an error1004:"Application-defined or object-
defined" while the error stop at [lastRow = Cells.Find
(What:="*", After:=[A1], SearchOrder:=xlByRows,
SearchDirection:=xlPrevious).Row]
Any tips or suggestion is appreciated.
jj
code:
============================================
Dim xlsApp, xlsBook, xlsSheet
CCCfile = GetCCCFile.GetCCCFile("CCCexcel")
Set xlsApp = CreateObject("Excel.Application")
Set xlsBook = xlsApp.Workbooks.Open(CCCfile)
Set xlsSheet = xlsBook.Sheets("Sheet1")
Dim lastACol As Integer
Dim lastBCol As Integer
Dim lastARow As Integer
lastRow = Cells.Find(What:="*", After:=[A1],
SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
lastBCol = Cells.Find(What:="*", After:=[A1],
SearchOrder:=xlByColumns,
SearchDirection:=xlPrevious).Column