View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
K[_2_] K[_2_] is offline
external usenet poster
 
Posts: 557
Default HOW TO PROTECT SAVEAS FILE

Hi all, I am using excel 2007. i have code (see below) in my macro
which save my file into "mht" "Single File Web Page" format.

CODE:===========================

Range("A13:L58").Select
With ActiveWorkbook.PublishObjects.Add(xlSourceRange, _
"C:\Documents and Settings\" & Range("A13").Value & " ( " &
Range("K16").Value & " )" & " - " & Range("K13").Value & ".mht", _
ActiveSheet.Name, "$A$13:$L$58", xlHtmlStatic, , "")
..Publish (False)
..AutoRepublish = False
End With
Range("B27").Select
End If
End Sub

<================================
My question is that how can i protect file sheet the one saved as in
"Single File Web Page" format so no one can make changes in it. I
know its some thing goes under ".AutoRepublish = False" but not sure.
Actually I am saving my 'Excel Macro-Enabled Workbook" format file
into "Single File Web Page" format which my other colleagues will open
in excel to view but i need some code line which should protect the
sheet of file which will be saved as "Single File Web Page" Format.
Please can any body help