H
Hlam
When editing the border lines of an excel workbook through Access I got
error message. Here are the codes in Access 2000:
Dim xlApp As Object 'New Excel.Application
Dim wb As Object 'workbook
Dim ws As Object 'worksheet
xlprog = Application.CurrentProject.Path & "\testBorder.xls"
Set xlApp = CreateObject("Excel.Application")
Set wb = xlApp.Workbooks.Open(xlprog)
Set ws = wb.ActiveSheet
ws.range(ws.cells(1, 1), ws.cells(10, 10)).Select
With xlApp.Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
End With
The error message is "Application Defined or Object Defined error"
The codes are recorded from an Excel book and pasted over to Access. Please
point out when am I wrong.
Thanks in advance
HL
error message. Here are the codes in Access 2000:
Dim xlApp As Object 'New Excel.Application
Dim wb As Object 'workbook
Dim ws As Object 'worksheet
xlprog = Application.CurrentProject.Path & "\testBorder.xls"
Set xlApp = CreateObject("Excel.Application")
Set wb = xlApp.Workbooks.Open(xlprog)
Set ws = wb.ActiveSheet
ws.range(ws.cells(1, 1), ws.cells(10, 10)).Select
With xlApp.Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
End With
The error message is "Application Defined or Object Defined error"
The codes are recorded from an Excel book and pasted over to Access. Please
point out when am I wrong.
Thanks in advance
HL