ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro pauses (https://www.excelbanter.com/excel-programming/337653-macro-pauses.html)

Gerry[_4_]

macro pauses
 
I have been running a macro for a few weeks. All of a sudden it began
stopping on one line, with no error message. I hit the play button and
the macro continues to the end.

Any ideas?

TIA
Gerry


Gary L Brown

macro pauses
 
Tell us what the line is, Gerry.
--
Gary Brown


"Gerry" wrote:

I have been running a macro for a few weeks. All of a sudden it began
stopping on one line, with no error message. I hit the play button and
the macro continues to the end.

Any ideas?

TIA
Gerry



Gerry Waldram

macro pauses
 
Here is the line it is pausing on.

ActiveWorkbook.SaveAs Filename:="C:\Shared
Data\RetailPro\Retail\Rpro\PRINT\Inventory for G Site
old.txt",FileFormat:=xlText, CreateBackup:=False

Gerry


*** Sent via Developersdex http://www.developersdex.com ***

Gary L Brown

macro pauses
 
My best guess is that in the past, after creating the file "Inventory for G
Site old.txt", it has been moved, deleted and/or name changed.

Try putting the following lines in front of the line that is pausing...

Application.DisplayAlerts = False 'turn warnings off
Kill :="C:\Shared Data\RetailPro\Retail\Rpro\PRINT\Inventory for G Site
old.txt"
Application.DisplayAlerts = True 'turn warnings on

This will delete the old file without stopping the code/displaying warnings
just before you are creating the file with your line...

ActiveWorkbook.SaveAs Filename:="C:\Shared
Data\RetailPro\Retail\Rpro\PRINT\Inventory for G Site
old.txt",FileFormat:=xlText, CreateBackup:=False


HTH,
--
Gary Brown

If this post was helpful, please click the ''''Yes'''' button next to
''''Was this Post Helpfull to you?".


"Gerry Waldram" wrote:

Here is the line it is pausing on.

ActiveWorkbook.SaveAs Filename:="C:\Shared
Data\RetailPro\Retail\Rpro\PRINT\Inventory for G Site
old.txt",FileFormat:=xlText, CreateBackup:=False

Gerry


*** Sent via Developersdex
http://www.developersdex.com ***


Gerry[_4_]

macro pauses
 
Thanks Gary



All times are GMT +1. The time now is 05:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com