ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Setting "DisplayGridlines" Programmatically (https://www.excelbanter.com/excel-programming/326026-setting-displaygridlines-programmatically.html)

Chaplain Doug

Setting "DisplayGridlines" Programmatically
 
I am trying to set the "DisplayGridlines" property of a worksheet
programmatically. I am getting an error when using:

Worksheets(<name of a valid sheet).DisplayGridlines = False

The error is:

Runtime error '438'
Object doen't support this property or method

How may I accomplish this task without error? Thanks and God bless.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org

Bob Phillips[_6_]

Setting "DisplayGridlines" Programmatically
 
Doug,

Gridlines applies to the window object, so use

Activewindow.Displaygridlines = False

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Chaplain Doug" wrote in message
...
I am trying to set the "DisplayGridlines" property of a worksheet
programmatically. I am getting an error when using:

Worksheets(<name of a valid sheet).DisplayGridlines = False

The error is:

Runtime error '438'
Object doen't support this property or method

How may I accomplish this task without error? Thanks and God bless.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org




Cesar Zapata

Setting "DisplayGridlines" Programmatically
 
Hello,

Correct syntax is :

ActiveWindow.DisplayGridlines = False


Cesar Zapata


Tom Ogilvy

Setting "DisplayGridlines" Programmatically
 
Just a hint, turn on the macro recorder and do it manually. Then your
question would be answered.

--
Regards,
Tom Ogilvy


"Chaplain Doug" wrote in message
...
I am trying to set the "DisplayGridlines" property of a worksheet
programmatically. I am getting an error when using:

Worksheets(<name of a valid sheet).DisplayGridlines = False

The error is:

Runtime error '438'
Object doen't support this property or method

How may I accomplish this task without error? Thanks and God bless.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org





All times are GMT +1. The time now is 01:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com