WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Excel
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Check if Column is Hidden

 Keywords: Excel Column Hidden Determine Check 

Question:

I have a questions in regards to excel. Here is my problem. I have a file with over 100 columns. I want to create a user file that has all hidden columns used in the past. So every time the program is run, it opens the file selected and automatically hides columns based on users preferences saved to a .txt with hideden columns outputed from the first time program was run. 1)I will open the file for the user, and they will manually hide the files they want. Once they hide them, they will save the file with the hidden columns. Here comes the problem. I want to re-open that file, and be able to tell what columns the user hide first time used. So how can I run a check to see if Column A or etc is hidden?
oXL=ObjectOpen("Excel.Application")
oXL.visible = @FALSE
oWbks = oXL.WorkBooks

oWbks.Open(filename)
A=oXL.Columns("A:A").Select

ColumnACheck=?????(Check if hidden and return a value)
If ColumnACheck== @false (or whatever)
HiddenColumn=FileWrite(NewFile,"A") ;This will write "A" to output file with username to be reloaded as saved preferences next time used.
endif
Thanks

Answer:

Try
If oWS.Range("A1").ColumnWidth=0 
  ColumnACheck = 1  ;column is hidden
Endif

Article ID:   W18101
Filename:   Check if Column is Hidden.txt
File Created: 2012:03:16:09:24:02
Last Updated: 2012:03:16:09:24:02