View Single Post
  #1   Report Post  
Danimagus
 
Posts: n/a
Default Macro Glitch Causing Crash


Hello all! I’m running into some problems with a spreadsheet I’m making.
I’m also fairly new to Excel, so I have no idea how to fix them. Now,
the big goal right now is to get a spreadsheet I’ve made to save itself
automatically as an HTML file whenever the worksheet is saved
conventionally with ctrl+s or file-save, etc. I currently have the
following code in the ThisWorkbook file.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\g9002741\My
Documents\System\EngineeringHealthGauges.htm" _
, FileFormat:=xlHtml, ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True

End Sub


Now, whenever I save, excel crashes and the changes are lost. Anyone
know how to fix my code or just get it to do what I want?

Also, I’ve also been wanting to put text in charts that changes based
on changes to some sort of source cell in the worksheet. That is, I’d
like titles and other text boxes to change when some cell in the
worksheet does.


--
Danimagus