Problem with file path to sharepoint

J

John Keith

I'm having a problem with a file path to a directory that is found on
a sharepoint. I've constructed the code below which I thought would
help me diagnose the problem but no luck so far.

Comments on the code below:

I am able to successfully open the workbook on the first line. The
workbook is located in the library/folder that is my ultimate target
directory. (I've shortenly the path for purpose of this inquiry, but
as I noted I can put the full path in the Workbooks.Open and open the
file.)

The next statement returns the full path to this file, the MsgBox here
and in other lines just lets me look at the variables.

The next statement then returns just the filename of the file opened.

The next statment then deletes the filename from the full path, in
order to get the path to just the directory.

Then the final line attempts to ChDir to this resulting path. At this
point I get an error message "Path Not Found".

Now, I think I've heard that sharepoints cannot be addressed this way
but I have a friend who can successfully do a ChDir to the explicit
path without problem (he is on Vista and I'm using XP, Excel 2007 in
both cases.) Another observation to note: if I map the sharepoint to
something like S: and change the path to S:\blahblah I can make the
ChDir statment work. I'd like to avoid mapping the drive if possible,
especially since my friend seems to be able to make it work. Any
suggestions?


Workbooks.Open Filename:= _
"https://blahblah_path/Shared Documents/Data 20101130.xls"
path = ActiveWorkbook.FullName ‘ Returns full path
MsgBox path
Filename = ActiveWorkbook.Name ‘Returns just the file name.
MsgBox Filename
path = Replace(path, Filename, "")
MsgBox path
ChDir path

John Keith
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top