Import Macro

molsen

Registered User.
Local time
Today, 09:46
Joined
Sep 13, 2012
Messages
50
I have a number of macro's, each of which initiate a saved import. The saved import looks for a specific file in a specific location. This works fine the first time I run it, but each week a new file has to be saved, named exactly as the saved import is configured, but when I run the macro, I keep getting the following preventative error message:

"SW842-12-Sep-2014$" is not a valid name. Make sure it does not include invalid characters or punctuation and that is it not too long"

The file name SW842-12-Sep-2014$ is not what the saved macro should be looking for, the macro is actually set as below:

W:\CHI users\NashM\Three Way Rec\SWAFL Files\SWFAL CHIG.xlsx

I end up having to manually create a new import each time, rather than configure a routine to perform a total of 21 imports.

Does anyone have any idea why this keeps happening and what I can do to resolve it? The error is not isolated to any one saved import, but all of them.

Many thanks
Mark:banghead:
 
How do you explain the major differences in the filename you are looking for and the error you get?

Thank you. I've just this minute sussed it out!

I actually receive a file from an external source as a CSV. I simply open it in Excel and save it with a file name which conforms to the file name specified in the macro. What I have just noticed is that the underlying name of the worksheet which appears within the file is different each time.

What I have to do, I think, is upon saving the file as a CSV, I will have to rename the worksheet with a simple name, much like Excel does it automatically if you dont name it yourself, like Sheet1.

Hopefully, job done!
 

Users who are viewing this thread

Back
Top Bottom