Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Preview Excel 2007 files in Outlook from SharePoint | Excel Discussion (Misc queries) | |||
Wht can't I open Excel files from Sharepoint any more? | Excel Discussion (Misc queries) | |||
Want to find/read excel files in SharePoint | Excel Programming | |||
Getting a list of files in a Sharepoint Folder | Excel Programming | |||
Excel Files with VBA Macros Stored on SharePoint | Excel Programming |