Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Problem with file path to sharepoint


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%20Documents/Data%2020101130.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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro File path problem DP7 Excel Programming 0 March 11th 08 06:45 PM
Exclude Network Path In PivotTable Based on Sharepoint eduboys Excel Discussion (Misc queries) 1 October 2nd 07 09:43 PM
Formula too long - new file path is shorter than old file path - Excel 2003 Greg J Excel Worksheet Functions 1 November 22nd 06 05:16 PM
Problem with default file path opi Excel Programming 6 March 29th 06 01:21 PM
File Path Problem Todd Huttenstine[_2_] Excel Programming 3 December 22nd 03 08:44 PM


All times are GMT +1. The time now is 11:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"