Link to home
Start Free TrialLog in
Avatar of cdmac2
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).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.

Thanks!
MikeMc

   
ASKER CERTIFIED SOLUTION
Avatar of Markus Fischer
Markus Fischer
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cdmac2
cdmac2

ASKER

Hey Harfang...

Sorry for the delayed response.  The first one you suggested did the trick.

Thanks!
MikeMc