June 25, 2016
I have used Application.Run (File.Name & "!UpdatePeriod") to call and run the macro, where UpdatePeriod is the macro name in each workbook. The issue I have is that if the filename may contain spaces or characters like (&-) and then the macro stops saying that it cannot access the macro. At the end of the macro I am resaving the file with a different name including the current period. Are there any guidelines or rules that I should be following in terms of naming conventions so that opening the file and running the macro is not an issue?
Many thanks in advance.
October 5, 2010
If you have posted this qs on another forum please let us know so we aren't duplicating effort.
As the answer on the other forum said, wrap your call in quotes
Application.Run ("'" & File.Name & "'!UpdatePeriod" Or don't use spaces in filenames. As a programmer I hate having to deal with spaces in filenames, URL's etc. Phil