Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code fails if ran more than once
Hello all,
I have pasted some of my code below. It runs fine the first time but if the user runs it again it hangs up on the .SaveAs line. If anyone can give me any insight as to why this is happening and/or suggestions to fix it I would be most gratful. Christy ;) With newbook.Sheets(1) .Cells(1).PasteSpecial xlPasteValues, , False, False .Columns("A:F").AutoFit .Range("A2,a19,a36,a53,a70,a87,a104").Select With Selection .NumberFormat = "m/d/yyyy" End With .Range("a1").Select Application.CutCopyMode = False End With With newbook .SaveAs FileName:=OfficeName, FileFormat:=xlNormal 'Handle the error if user clicks "NO" at Outlook security pop-up On Error Resume Next .SendMail MyArr, Sheet1.Range("a99").Value On Error GoTo 0 .Close True End With |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Filtering Fails | Excel Discussion (Misc queries) | |||
Code fails when sheet is protected | Excel Discussion (Misc queries) | |||
Named Range Fails in VBA Code | Excel Programming | |||
solver.xla fails | Excel Programming | |||
Logitech's newest mouse scroll fails in VBE code pane | Excel Programming |