Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Gail Knight   on Dec 10 In MS Office Category.

  
Question Answered By: Francis Riley   on Dec 10

1) Before you define this as a function, temporarily modify it to a sub,
so you can check code execution.

2) I strongly recommend you use InStrRev with all optional stuff filled
in, especially the vbvompare bit. So that line  should become

intLoc = InStrRev(strFullPath,"\",1,1) ' Start from position 1, and
compare for text.

Now, change the debug.print line to the following:

Debug.Print intLoc, " || ", strreturn

It should lead you to the answer. And if you can't wait, read on.
------------------------------------------------------------------------
----------------------------------------
You are looking in the full path, from the right, to where the first "\"
is. Now that you have that position, you are asking for all the stuff to
the LEFT of it, excluding the "\" as well.

I think you are getting the answer you have programmed the code to give.
If you want the full path, then that is available as strFullPath...

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Path is not set completely Or get search suggestion and latest updates.


Tagged: