Excel 2010 - Windows XP
I have an Excel spreadsheet that I am saving as html. When I do the "Frozen" columns and rows are not frozen any more. Is there a way to keep these columns and rows frozen..
Below is the VBA I am uing to do this.
Sub Update_HTML()
'
' Update_HTML Macro
' Macro to save HTML file
'
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Delete the old HTML file if it exist.
If objFSO.FileExists("\\usmmaw01\wwwroot\Applications\RFS_Schedule\Priority_List.mht") Then
objFSO.Deletefile ("\\usmmaw01\wwwroot\Applications\RFS_Schedule\Priority_List.mht")
End If
'Save the new HTML file.
With Sheets("MASTERDATA").Select
ActiveWindow.SelectedSheets.Visible = False
Sheets("Current").Select
Cells.Select
Selection.Font.Size = 8
Cells.EntireRow.AutoFit
Dim sh As Worksheet
For Each sh In Worksheets
If sh.Name <> "Current" Then sh.Visible = xlSheetHidden
Next
End With
Dim shu As Worksheet
For Each shu In Worksheets
If shu.Name = "Week 1" Then shu.Visible = True
Next
Sheets("Week 1").Select
Cells.Select
Selection.Font.Size = 8
Cells.EntireRow.AutoFit
Sheets("Current").Select
With ActiveWorkbook.PublishObjects.Add(xlSourceWorkbook, _
"\\usmmaw01\wwwroot\Applications\RFS_Schedule\Priority_List", "Schedule", "", xlHtmlStatic, _
"Converting Morning Report AB hourly_15241", "")
.Publish (True)
.AutoRepublish = False
End With
End Sub
Thanks
Alan
I have an Excel spreadsheet that I am saving as html. When I do the "Frozen" columns and rows are not frozen any more. Is there a way to keep these columns and rows frozen..
Below is the VBA I am uing to do this.
Sub Update_HTML()
'
' Update_HTML Macro
' Macro to save HTML file
'
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Delete the old HTML file if it exist.
If objFSO.FileExists("\\usmmaw01\wwwroot\Applications\RFS_Schedule\Priority_List.mht") Then
objFSO.Deletefile ("\\usmmaw01\wwwroot\Applications\RFS_Schedule\Priority_List.mht")
End If
'Save the new HTML file.
With Sheets("MASTERDATA").Select
ActiveWindow.SelectedSheets.Visible = False
Sheets("Current").Select
Cells.Select
Selection.Font.Size = 8
Cells.EntireRow.AutoFit
Dim sh As Worksheet
For Each sh In Worksheets
If sh.Name <> "Current" Then sh.Visible = xlSheetHidden
Next
End With
Dim shu As Worksheet
For Each shu In Worksheets
If shu.Name = "Week 1" Then shu.Visible = True
Next
Sheets("Week 1").Select
Cells.Select
Selection.Font.Size = 8
Cells.EntireRow.AutoFit
Sheets("Current").Select
With ActiveWorkbook.PublishObjects.Add(xlSourceWorkbook, _
"\\usmmaw01\wwwroot\Applications\RFS_Schedule\Priority_List", "Schedule", "", xlHtmlStatic, _
"Converting Morning Report AB hourly_15241", "")
.Publish (True)
.AutoRepublish = False
End With
End Sub
Thanks
Alan