I'm working with VBA for the first time on a Mac, so I don't know if the problem is because of this. But lets go:
I have recorded a macro that imports a specific text-file (this works). I then tried testing the macro by renaming the file to be imported in the code. I'll try and show it.
This code is recorded and works.
Then I tried changing this line:
To:
Note that at this point I haven't tried recording a macro that imported the August file.
After that I tried recording the importmacro for August and changed August in the line to July, and it worked. I then changed it to June (a month I haven't imported manually) and then it didn't work and came up with the runtime error 1004 and highlighting the last line in the code:
So, I have no idea why it doesn't work, because the files does exist in the folder, so changing the monthname in the code should work.
Anyone know what to do?
Bookmarks