rakesh seebaruth
Active Member
- Joined
- Oct 6, 2011
- Messages
- 303
Hi,
I have the following code
Sub saveas()
mydrive = "C:"
mydir = "excel"
myname = Sheets("sheet1").Range("e5")'
ms = mydrive & "\" & mydir & "\" & myname & ".xls"
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:=ms
Application.DisplayAlerts = True
End Sub
I want vba to check in C:excel if file("e5") exists .If exists overwrite,and protect with password ,and save it.
If does not exists then save it as save as .
I'm using excel 2003
thnaks
I have the following code
Sub saveas()
mydrive = "C:"
mydir = "excel"
myname = Sheets("sheet1").Range("e5")'
ms = mydrive & "\" & mydir & "\" & myname & ".xls"
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:=ms
Application.DisplayAlerts = True
End Sub
I want vba to check in C:excel if file("e5") exists .If exists overwrite,and protect with password ,and save it.
If does not exists then save it as save as .
I'm using excel 2003
thnaks