![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 2
|
Public Sub SaveAsA1()
ThisFile = Range("A1").Value ActiveWorkbook.SaveAs Filename:=ThisFile End Sub I am using the above macro in my spread sheet. If you have saved a file it asks if you wish to over write and if you say no or cancel it kicks the debugger on. How do I avoid this or get pass the error? |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
|
Hi,
You just need to use Application.DisplayAlerts=False e.g. Public Sub SaveAsA1() ThisFile = Range("A1").Value Application.DisplayAlerts = False ActiveWorkbook.SaveAs Filename:=ThisFile Application.DisplayAlerts = True End Sub HTH, D |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|