#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Macro Hangs

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro hangs up often but sometimes works fine Jeff Excel Worksheet Functions 3 June 13th 06 01:01 PM
Excel macro convert to VBA - doesn't work, hangs on Range("Q35").Select Harold Good Excel Programming 3 January 13th 06 09:09 PM
VBA Hangs sponny Excel Programming 2 November 4th 05 02:58 PM
Macro hangs my excel (not responding) Jeff Excel Programming 3 September 9th 05 12:41 AM


All times are GMT +1. The time now is 08:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"