Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro File path problem | Excel Programming | |||
Exclude Network Path In PivotTable Based on Sharepoint | Excel Discussion (Misc queries) | |||
Formula too long - new file path is shorter than old file path - Excel 2003 | Excel Worksheet Functions | |||
Problem with default file path | Excel Programming | |||
File Path Problem | Excel Programming |