Link to home
Start Free TrialLog in
Avatar of Walter Grimm
Walter Grimm

asked on

Hide row and column headers from VB Addin

Hide row and column headers from VB Addin, and other viewproperties

I have googled this very deeply, checked the object browser in VS2017. I could come up with something like this below:

There is the worksheetview object, that has the prop DisplayHeadings.

The samples are all VBA, when i use it in the addin, the intelisense will give me wsvw.DisplayHeadings, but I will then receive a runtime error.

QUESTION: how can i use a worksheetview on a single worksheet in VB to modify the view and other properties

https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.interop.excel.worksheetview.displayheadings?view=excel-pia
http://codevba.com/excel/WorksheetView.htm#.XGH4Zlz0lEZ

                Dim wnd As Window
                Dim wsvw As WorksheetView
                For Each wsvw In wnd     'AddinModule.Checklistworkbook.Worksheets
                    MsgBox(wsvw.DisplayHeadings.ToString & " - " & wsvw.Sheet.ToString)
                Next wsvw

Open in new window

Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

I haven't used the WorksheetView object, but in VBA the sheet must be activated before you can change the DisplayHeadings property.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.