Hi Claude,
What kind of an answer are you looking for ?
You can have a macro with the Excel file.
If the Excel file is created with a template, you can change
the template to use borders.
If you have control of the Excel, then you wouldn't have a
problem so that's probably not the case.
Are there many different Excel files.
Who has control of the Excel file as it goes to Webview (guess
it's not Excel's conversion to HTML),
A macro to generate the borders is a bit complicated, so here
is what is generated from recording a macro with a slight change
of "selection." to "cells." . As you can see you have to set
each type of border Top, right, bottom, left, inside, and diagonals.
Sub Macro1()
Cells.Borders(xlDiagonalDown).LineStyle = xlNone
Cells.Borders(xlDiagonalUp).LineStyle = xlNone
With Cells.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Cells.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Cells.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Cells.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Cells.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Cells.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub
--
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages:
http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page:
http://www.mvps.org/dmcritchie/excel/search.htm
Claude Allard said:
David,
Thanks for the suggestion. The main problem with that method is that
the user has to do this. I'm looking for a way for Excel (or some other
process) to automatically do it for the user.
David said:
Hi Claude,
I never use the builtin HTML but did you try using borders
instead of gridlines.
Select cells (Ctrl+A), Format, cells, border, ...
or use the toolbar icon for the formatting of selected cells.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages:
http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page:
http://www.mvps.org/dmcritchie/excel/search.htm
claude allard said:
Greetings,
I have an html file that displays data in a table format. I can open
this file with Excel and it will display all the data in the proper
format. I would like to automatically apply grid lines to this data as
I open the file. The html file name will vary (generated by Webview
table generating tool). Is it possible to do this? I have a macro that
will apply the grid lines to the spread sheet but I have to go to
tools/macro/VBE and then add the code and run it. I have general users
opening these html files with Excel and they just want to see the data
with grid lines around it.
Any help would be greatly appreciated. TIA.
Claude Allard