View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Grace[_4_] Grace[_4_] is offline
external usenet poster
 
Posts: 106
Default Filename problem

Rob and Frank,

I tried the re-dimensioning and it did not help. I also changed the name of
the filename to start with "Joe" instead of this string, which I input, and
changed the subroutine call to use a hard-wired "Joe" instead of this
starting string, and it found the file just fine with that.

As I mentioned earlier, the file has no trouble naming a file that it "saves
as" with this same problematic string. It just can't seem to understand it,
when it is trying to find the file to open. What could this be? I used
edit search to make sure the spelling was identical and it was.

"Grace" wrote in message
...
Rob suggested the ampersands too, but it did not help. I don't know what
you mean by

Also check the content of the variable 'MGR_SHORT_NAME'
you may include the line
msgbox myFilename
and check the concatenation


other than that I should check the spelling. What else did you mean? I
did. In fact, I used that same string in another prior filename ands it
works there. As I just asked Rob, could it be that it is not

re-dimensioned
in a subroutine that the main subroutine calls (which is also the first
place the macro bombs)?

Thanks
Grace


"Frank Kabel" wrote in message
...
Hi
try
myFilename = MGR_SHORT_NAME & Sheets("Inputs").Range("E11").Value &
"SUMPRF"
& ".L00"

Also check the content of the variable 'MGR_SHORT_NAME'
you may include the line
msgbox myFilename
and check the concatenation



--
Regards
Frank Kabel
Frankfurt, Germany


Grace wrote:
Is there something wrong with the following code?

myFilename = MGR_SHORT_NAME + Sheets("Inputs").Range("E11").Value +
"SUMPRF" + ".L00"

It keeps bombing out when it goes to find this file, because the
actual file, of course, was named so that it has the MGR_short_name
in the front part of its name, but the macro doesn't seem to
recognize it, i.e., when it responds that it cannot find the file,
the name it says it is looking for, does not have this first part.

Thanks,
Grace