I am writing code that opens up other workbooks and copy/pastes the charts into my original workbook.
Currently, my code looks like this
Dim GrabFileLocation as String
Dim MRB as String
GrabFileLocation = Application.GetOpenFilename()
MRB = Right(GrabFileLocation, 18)
' Open
Workbooks.Open (MRB)
This is problematic, as if the length of the file name ever changes, my macro won't be able tot open the file properly. Is there a better way to do this?
My thought was, maybe theres some way to associate the file location with a wildcard, e.g.
GrabFileLocation = C:\Users\LewisGoose\*
where the wildcard is the file name, then I could say
where the wildcard is the EXACT wildcard from GrabFileLocation.
This is just a thought on how to best call a filename. If anyone has a better idea, please let me know. Thanks!
Bookmarks