Reputation: 11
I am a naive user of VBA and I am looking for a VBA macro which would do the following task
I tried the code available on this link Run same excel macro on multiple excel files
At the line
Filename=Dir(Pathname & "*.xlsx")
, I am getting an error which says run time error "52" Bad file name or number
.
I have changed this:
Pathname = "\C:\Users\Desktop\test\try\"\
Is this correct?
Upvotes: 1
Views: 494
Reputation: 1592
Not sure if it's your only problem, but
\C:\Users\Desktop\test\try\
should be
C:\Users\Desktop\test\try\
(without the first backslash)
*I realize this should be a comment--I'm under 50 rep, however.
Upvotes: 1