Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
P
Dear All,
I am using following to apply macro on all files in a folder. on close of everyfile the msg box appear, you want to save and three option Yes No Cancel. How its possible that all the files saves and go on next file without appearing any msg box? Your help required with thnx Sub list_um() Dim F As String Dim roww As Long roww = 0 Dim FileLocSpec As String FileLocSpec = "C:\Hassan\*.csv" F = Dir(FileLocSpec) Do Until F = "" roww = roww + 1 Cells(roww, 1).Value = F F = Dir Loop Set r = Range("A1") While r.Value < "" Workbooks.Open Filename:="C:\Hassan\" & r.Value Call Wathba ActiveWorkbook.Save ActiveWorkbook.Close Set r = r.Offset(1, 0) Wend End Sub |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
P
Instead of
ActiveWorkbook.Save ActiveWorkbook.Close use ActiveWorkbook.Close SaveChanges:=True "TFMR" wrote: Dear All, I am using following to apply macro on all files in a folder. on close of everyfile the msg box appear, you want to save and three option Yes No Cancel. How its possible that all the files saves and go on next file without appearing any msg box? Your help required with thnx Sub list_um() Dim F As String Dim roww As Long roww = 0 Dim FileLocSpec As String FileLocSpec = "C:\Hassan\*.csv" F = Dir(FileLocSpec) Do Until F = "" roww = roww + 1 Cells(roww, 1).Value = F F = Dir Loop Set r = Range("A1") While r.Value < "" Workbooks.Open Filename:="C:\Hassan\" & r.Value Call Wathba ActiveWorkbook.Save ActiveWorkbook.Close Set r = r.Offset(1, 0) Wend End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|