A
Al
I am trying to hide a column in an excel file without having to make it
visible. the code below makes the whole work book hidden, I do not know why.
I, ultimately, need to be able to hide several columns, in any file that I
enter in a text box on a form and save the file.
thanks
Dim strPath As String, wsData As Worksheet, strFile As String
Dim xlApp As Excel.Application
Dim xlWb As Excel.Workbook
Dim xlWs As Excel.Worksheet
Dim xlRng As Excel.Range
strPath = Me.txtexcel
strFile = "hidc.xls"
Set xlApp = New Excel.Application
xlApp.Visible = True
Set xlWb = GetObject(strPath & strFile, "Excel.Sheet")
Set xlWs = xlWb.ActiveSheet
With xlWs
.Columns("C").Hidden = True
End With
xlWb.Close SaveChanges:=True
visible. the code below makes the whole work book hidden, I do not know why.
I, ultimately, need to be able to hide several columns, in any file that I
enter in a text box on a form and save the file.
thanks
Dim strPath As String, wsData As Worksheet, strFile As String
Dim xlApp As Excel.Application
Dim xlWb As Excel.Workbook
Dim xlWs As Excel.Worksheet
Dim xlRng As Excel.Range
strPath = Me.txtexcel
strFile = "hidc.xls"
Set xlApp = New Excel.Application
xlApp.Visible = True
Set xlWb = GetObject(strPath & strFile, "Excel.Sheet")
Set xlWs = xlWb.ActiveSheet
With xlWs
.Columns("C").Hidden = True
End With
xlWb.Close SaveChanges:=True