Hello,
Wondering if someone can help with this auto macro. Basically all I'm doing in this test sheet is changing the colors of some cells, Saving the sheet, then saving the sheet a .mht file, and closing excel.
I'm getting an error that says "Code execution has been interrupted", when I click debug it highlights this line as being a problem
"ActiveWorkbook.SaveAs Filename:="C:\HTM\APP\CO\Test1.mht", FileFormat:=xlWebArchive, CreateBackup:=False"
I have also noticed that if I run the code by holding down the F8 button it works fine with no errors. I have been working on this all day trying to figure it out. Any help would be appreciated. Thanks
Wondering if someone can help with this auto macro. Basically all I'm doing in this test sheet is changing the colors of some cells, Saving the sheet, then saving the sheet a .mht file, and closing excel.
I'm getting an error that says "Code execution has been interrupted", when I click debug it highlights this line as being a problem
"ActiveWorkbook.SaveAs Filename:="C:\HTM\APP\CO\Test1.mht", FileFormat:=xlWebArchive, CreateBackup:=False"
I have also noticed that if I run the code by holding down the F8 button it works fine with no errors. I have been working on this all day trying to figure it out. Any help would be appreciated. Thanks
Code:
Sub auto_open()
'
' auto_open Macro
Range("A1:Q29").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("A1").Select
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs "C:\HTM\APP\CO\Test1.xlsm"
ActiveWorkbook.SaveAs Filename:="C:\HTM\APP\CO\Test1.mht", FileFormat:=xlWebArchive, CreateBackup:=False
Application.DisplayAlerts = True
Application.Quit
[\Code]
Last edited: