Hi,
How do I add/edit borders in an Excel file using Access. I have code that export's data to an Excel file and then formats the contents. Everything works except it gives me an error when i try to create borders around certain cells. I used Excel's macro recorder to get the code for manipulating borders, so I can't figure out what's wrong.
Here's my code for setting up a border at a bottom of a cell (as I got it from Excel macro recorder, minus the "m_objExcel" object):
With m_objExcel.Selection.Borders(.xlEdgeBottom)
.linestyle = .xlcontinuous
.Weight = .xlHairLine
.ColorIndex = .xlAutomatic
End With
m_objExcel is the name of my Excel object.
Access seems to have problems using any statements that specify (if that makes any sense) like the xlEdgeBottom and Shift:=.xlDown when you insert rows in an Excel spreadsheet.
Am I doing something wrong or is there a way around this.
Please help soon,
Mike.
How do I add/edit borders in an Excel file using Access. I have code that export's data to an Excel file and then formats the contents. Everything works except it gives me an error when i try to create borders around certain cells. I used Excel's macro recorder to get the code for manipulating borders, so I can't figure out what's wrong.
Here's my code for setting up a border at a bottom of a cell (as I got it from Excel macro recorder, minus the "m_objExcel" object):
With m_objExcel.Selection.Borders(.xlEdgeBottom)
.linestyle = .xlcontinuous
.Weight = .xlHairLine
.ColorIndex = .xlAutomatic
End With
m_objExcel is the name of my Excel object.
Access seems to have problems using any statements that specify (if that makes any sense) like the xlEdgeBottom and Shift:=.xlDown when you insert rows in an Excel spreadsheet.
Am I doing something wrong or is there a way around this.
Please help soon,
Mike.