Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default List files on SharePoint

I'm writing a vba program to get a list of Excel files on a SharePoint Team
Website (SharePoint 2003 and Excel 2003) and am getting an error. This
program works fine when run in Excel 2007 but I get a Runtime Error "Network
Name Cannot be Found" when I run the exact same code in Excel 2003. Here is
the code:

dim wMastBook as workbook, wSharepoint as Object, f as integer, sFileList()
as string
dim sFileName as string
'where path = "https://share.domain.com/Shared Directory"
Set wSharepoint = CreateObject("WScript.Network")
On Error Resume Next
wSharepoint.removenetworkdrive "q:", True
On Error GoTo 0
wSharepoint.mapnetworkdrive "q:", wMastBook.Path 'runtime error here
ChDrive "q:"
sFileName = Dir("*.xl*")
s = 0
While sFileName < ""
s = s + 1
ReDim Preserve sListFiles(s)
sListFiles(s) = sFileName
sFileName = Dir
Wend
wSharepoint.removenetworkdrive "q:", True

I've also tried the Application.Filesearch method with no errors but it
cannot find any files.

This is maddening since it works fine in Excel 2007 (the
Application.Filesearch method does not work in Excel 2007). Any help is
appreciated.
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
Preview Excel 2007 files in Outlook from SharePoint Barb Reinhardt Excel Discussion (Misc queries) 0 May 6th 10 08:48 PM
Wht can't I open Excel files from Sharepoint any more? HH Excel Discussion (Misc queries) 1 January 17th 10 08:49 PM
Want to find/read excel files in SharePoint BCNU Excel Programming 0 November 5th 07 11:04 PM
Getting a list of files in a Sharepoint Folder John Excel Programming 0 June 12th 07 09:58 PM
Excel Files with VBA Macros Stored on SharePoint Jane Excel Programming 0 July 19th 06 08:47 PM


All times are GMT +1. The time now is 09:21 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"