cdmac2
asked on
Hide Gridlines in Excel Object on Access form
Hello,
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).Column s(7).Numbe rFormat = "$#,##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.DisplayGridli nes = False
Which returns the error: "Object variable or WIth block variable not set"
I've tried a few different iterations:
objXL.worksheets(1).Displa yGridlines = False
objXL.worksheets(1).Active Window.Dis playGridli nes = False
but none of them worked.
Any help would be greatly appreciated.
Thanks!
MikeMc
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).Column
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.DisplayGridli
Which returns the error: "Object variable or WIth block variable not set"
I've tried a few different iterations:
objXL.worksheets(1).Displa
objXL.worksheets(1).Active
but none of them worked.
Any help would be greatly appreciated.
Thanks!
MikeMc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry for the delayed response. The first one you suggested did the trick.
Thanks!
MikeMc