Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default bad file name or number - accesing sharepoint folder


I am working on a macro that required the ability to loop through all
the files in a folder. I did all my development work on a folder in
the My Documents folder and got everything working correctly there.

Then I started the process of moving the target folder to a sharepoint
where all the real files lived. As soon as I did this and adjusted all
the paths I immediately got an error message "Bad file name or number"
from the following line:

First, this is the line that worked on my local drive:

'sfname = Dir("C:\Documents and Settings\keithjo\My
Documents\Test\*.xls")

and this is the line that now produces the error:

sfname = Dir("https://xx/yy/CIS/Shared Documents/*.xls")

(I've replaced the xx and yy to get this on one line)

I'm pretty sure the path is correct as I did a cut and paste from the
address line in windows Explorer and I've tried both " " and "%20" in
the space between Shared and Doucments but have not had an success
yet.

Any suggestions on what I might be missing?

I can pist more code if needed but I'm pretty sure it is this one
statement.


TIA


John Keith

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default bad file name or number - accesing sharepoint folder

On Sun, 27 Sep 2009 14:56:59 -0600, John Keith wrote:

I'm pretty sure the path is correct as I did a cut and paste from the
address line in windows Explorer and I've tried both " " and "%20" in
the space between Shared and Doucments but have not had an success
yet.


I should note that if I try to open a file that I know is in the
folder it does open without any error message.


John Keith

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default bad file name or number - accesing sharepoint folder

On Sun, 27 Sep 2009 14:56:59 -0600, John Keith wrote:

More info, I added a CHDir line:

ChDir = "https://xx/yy/CIS/Shared Documents"

and I get a 'Directory not found' error message.

But I can still open a specific file in this directory. There has to
be something simple that I'm overlooking.


John Keith

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default bad file name or number - accesing sharepoint folder

A web server is not a filesystem (OK I know it is underneath, but it's not
exposed in the same way).
Being able to open a file in Excel from a http location is just an added
convenience, but you can't use Dir() on a http location,

If this is an intranet situation then you may be able to map a drive on to
the shareweb server:
\\xx\xx\CIS\Shared Documents\

Provided you have access privileges that is.

Tim

"John Keith" wrote in message
...
On Sun, 27 Sep 2009 14:56:59 -0600, John Keith wrote:

More info, I added a CHDir line:

ChDir = "https://xx/yy/CIS/Shared Documents"

and I get a 'Directory not found' error message.

But I can still open a specific file in this directory. There has to
be something simple that I'm overlooking.


John Keith



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default bad file name or number - accesing sharepoint folder

On Sep 27, 7:46*pm, "Tim Williams" wrote:
A web server is not a filesystem (OK I know it is underneath, but it's not
exposed in the same way).
Being able to open a file in Excel from a http location is just an added
convenience, but you can't use Dir() on a http location,

If this is an intranet situation then you may be able to map a drive on to
the shareweb server:
\\xx\xx\CIS\Shared Documents\

Provided you have access privileges that is.


Tim,

Thank you for pointing out the distinction!!! I think that is exactly
the issue I'm facing. And yes, I can map the drive and I do have
access so I'm going to go try it right now.

Thanks again, I was hoping I would have a solution before the start of
the week!

John


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default bad file name or number - accesing sharepoint folder

On Sep 27, 7:46*pm, "Tim Williams" wrote:
If this is an intranet situation then you may be able to map a drive on to
the shareweb server:
\\xx\xx\CIS\Shared Documents\


Tim,

It's working great! I'm ready to roll tomorrow. Thanks again.

JK
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
How add a site in "My SharePoint Sites€¯ folder of Favorite Links Vernon Tyger Excel Discussion (Misc queries) 1 July 27th 09 02:50 PM
Check for file in folder, if not there, open folder to rename file Don M. Excel Programming 9 October 22nd 08 07:34 PM
Getting a list of files in a Sharepoint Folder John Excel Programming 0 June 12th 07 09:58 PM
Save file in a new folder, but create folder only if folder doesn't already exist? nbaj2k[_40_] Excel Programming 6 August 11th 06 08:41 PM
Need code to save file to new folder, erase from old folder Ron M. Excel Discussion (Misc queries) 1 February 24th 06 06:02 PM


All times are GMT +1. The time now is 08:25 PM.

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

About Us

"It's about Microsoft Excel"