Becca Posted June 3, 2018 Share Posted June 3, 2018 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 Link to comment Share on other sites More sharing options...
TheXman Posted June 3, 2018 Share Posted June 3, 2018 (edited) DisplayGridlines is a property of the Window object not the Worksheet object. https://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.window.displaygridlines.aspx A simple search of the forum would have provided numerous examples; like the one below: Edited June 3, 2018 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Becca Posted June 3, 2018 Author Share Posted June 3, 2018 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. Link to comment Share on other sites More sharing options...
TheXman Posted June 3, 2018 Share Posted June 3, 2018 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. CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Becca Posted June 3, 2018 Author Share Posted June 3, 2018 Ah! I see now. Thank you for your help. Sorry for being so dense. Link to comment Share on other sites More sharing options...
water Posted June 3, 2018 Share Posted June 3, 2018 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Becca Posted June 4, 2018 Author Share Posted June 4, 2018 Thank you water! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now