Jump to content
Becca

How do I auto-set View Gridlines?

Recommended Posts

Becca

I have a couple of autoit routines that merge several Excel spreadsheets into one. One of the routines does not show the gridlines in the View mode. (Gridlines show when printed.) The original spreadsheets -- which are output from a database application -- also do not have 'View Gridlines' selected. How do I get the final merged spreadsheets to auto-set this feature? I have tried:

$oExcel.ActiveSheet.DisplayGridlines=True

and

$oExcel.ActiveSheet.PrintGridlines=True

and

$oExcel.ActiveSheet.ViewGridlines=True

but no luck so far.

Any help would be greatly appreciated.

Thank you

Share this post


Link to post
Share on other sites
Becca

Yes, I have done several searches. I found the result you refer to and it was the closest I could find to what I'm trying to do; I was hoping I could apply the same command to a worksheet. I'll try again and specify worksheet in the search. Maybe that will help.

Share this post


Link to post
Share on other sites
TheXman
6 minutes ago, Becca said:

I was hoping I could apply the same command to a worksheet.

Let me save you some time.  Like I said in my previous post, the DisplayGridlines property is a property of the Excel Window object.  That property does not exist for the Excel Worksheet object.  If you looked at the post that I linked to, you will see one way to do exactly what it is you are trying to do, which is to enable/disable the displaying of gridlines.

Share this post


Link to post
Share on other sites
Becca

Ah! I see now. Thank you for your help. Sorry for being so dense.

Share this post


Link to post
Share on other sites
water

NB.: Everything you can do manually in Excel, can be recorded with the macro recorder and then easily be translated to AutoIt.

http://www.contextures.com/excel-macro-record-test.html


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Becca

Thank you water!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×