K
KevinF
I am writing a script to populate an excel speadsheet.
All works ok until I try and but borders around the results.
The snipet of code below is how I have tried to create the borders but with
ne results.
with (Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).Borders(xlEdgeLeft))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}
with
(Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).Borders(xlEdgeRight))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}
with (Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).Borders(xlEdgeLeft))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}
with (Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).Borders(xlEdgeTop))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}
with
(Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).Borders(xlEdgeBottom))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}
with
(Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).Borders(xlInsideHorizontal))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}
with
(Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).Borders(xlInsideVertical))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}
The problem appears to be with the Range statement.
Can anyone over advise?
Regards
Kevin
All works ok until I try and but borders around the results.
The snipet of code below is how I have tried to create the borders but with
ne results.
with (Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).Borders(xlEdgeLeft))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}
with
(Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).Borders(xlEdgeRight))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}
with (Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).Borders(xlEdgeLeft))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}
with (Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).Borders(xlEdgeTop))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}
with
(Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).Borders(xlEdgeBottom))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}
with
(Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).Borders(xlInsideHorizontal))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}
with
(Report.Range(Cells(ExcelRow,2),Cells(EndRow,6)).Borders(xlInsideVertical))
{
LineStyle = xlContinuous;
Weight = xlThick;
ColorIndex = xlAutomatic;
}
The problem appears to be with the Range statement.
Can anyone over advise?
Regards
Kevin