I am trying to format an excel object that I have embedded in an Access form. I have included the Microsoft Excel Lib as a reference to my project.
Most of the standard Excel formatting commands work. For example,
objXL.worksheets(1).Columns(7).NumberFormat = "$#,##0"
works fine for formatting a column to currency.
I can't seem to get the gridlines to turn off. The standard Excel command is
ActiveWindow.DisplayGridlines = False
Which returns the error: "Object variable or WIth block variable not set"
I've tried a few different iterations:
objXL.worksheets(1).DisplayGridlines = False
objXL.worksheets(1).ActiveWindow.DisplayGridlines = False
but none of them worked.
Any help would be greatly appreciated.