Macro Hangs

G

GregR

I have the macro below which runs as expected first time through. The
seconD time it hangs on the line:
Application.Dialogs(xlDialogSendMail).Show

Sub SaveToPOLOG()

Dim WBtemp As Workbook
Dim strFileName As String

Application.EnableEvents = False
Application.DisplayAlerts = False

strFileName = Range("D6").Value & " - " & Range("D36").Value & ".xls"
ActiveSheet.Copy
ActiveSheet.Name = "PO " & Range("D6").Value

ActiveWorkbook.SaveAs Filename:=("C:\Documents and Settings\GregR\My
documents\POs\") & _
strFileName

ActiveWorkbook.SaveAs Filename:=("G:\IS\ISFinancials\Purchase
Orders\POs\") & _
strFileName

Set WBtemp = ActiveWorkbook
ActiveWorkbook.SaveAs Filename:="C:\Temp\PO " & Range("D6").Value &
".xls"

On Error Resume Next
Application.Dialogs(xlDialogSendMail).Show 'HANGS HERE"
On Error GoTo 0

WBtemp.Close SaveChanges:=False
Kill "C:\Temp\PO*"

Application.EnableEvents = True
Application.DisplayAlerts = True

End Sub

Any help appreciated. TIA

Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top