Re: $$Excel-Macros$$ Macro error in opening file

2016-04-28 Thread Paul Schreiner
I simplified the macros wrote two versions.One using Dir() and another with the FileSystem object. they both work just fine: Sub First_Macro()     Dim MyFile As String     Dim path As String         path = "D:\For Pankaj\Dump\"     MyFile = Dir(path & "*L1.xlsx")         Do While MyFile <> ""   

Re: $$Excel-Macros$$ Macro error in opening file

2016-04-28 Thread Abhishek Jain
It is working perfectly fine at my end. On Thu, Apr 28, 2016 at 11:36 AM, Secret Shot wrote: > I tried that option... When I am using > > Workbooks.Open (path & MyFile) > > Then my loop is going in infinity and every time it is reopening the first > file only.. Which 04 L1. Xlsx > > Pls suggest

Re: $$Excel-Macros$$ Macro error in opening file

2016-04-27 Thread Secret Shot
I tried that option... When I am using Workbooks.Open (path & MyFile) Then my loop is going in infinity and every time it is reopening the first file only.. Which 04 L1. Xlsx Pls suggest On Apr 28, 2016 11:02 AM, "Abhishek Jain" wrote: > In your first macro, instead of: > > Workbooks.Open (My

Re: $$Excel-Macros$$ Macro error in opening file

2016-04-27 Thread Abhishek Jain
In your first macro, instead of: Workbooks.Open (MyFile) use: Workbooks.Open (path & MyFile) HTH On Thu, Apr 28, 2016 at 9:26 AM, Secret Shot wrote: > Hi all, > > Can anybody pls look into it. I am really hoping that I will get > resolution from this forum. > On Apr 28, 2016 1:35 AM, "Secre

Re: $$Excel-Macros$$ Macro error in opening file

2016-04-27 Thread Secret Shot
Hi all, Can anybody pls look into it. I am really hoping that I will get resolution from this forum. On Apr 28, 2016 1:35 AM, "Secret Shot" wrote: > Dear Experts, > > I want to open all files in a folder with suffix of "L1", where i have > below files in a folder > > 04 L1.Xlsx > 04 L2.Xlsx > 05

$$Excel-Macros$$ Macro error in opening file

2016-04-27 Thread Secret Shot
Dear Experts, I want to open all files in a folder with suffix of "L1", where i have below files in a folder 04 L1.Xlsx 04 L2.Xlsx 05 L1.Xlsx 05 L2.Xlsx 06 L1.Xlsx 06 L2.Xlsx I want macro to open Only files which contain "L1", (Means 04 L1.Xlsx, 05 L1.Xlsx, 06 L1.Xlsx). I created 2 macros but b