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


Is there a way to search a SharePoint site to see if a Workbook exists? I
have CanCheckOut working, but the problem is that if the workbook is already
checked-out or if it doesn't exist I think I get the same response(can't
checked-out). If the Workbook is already checked-out then I will display a
message "The file is already checked out. Try again later". However, if the
file does not exits then I want to search for an earlier file.
Thanks for your time and expertice in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default Search SharePoint for Workbook


Here's a User-Defined-Function that might help...

'/===============================/
' Function Purpose:
' Return TRUE or FALSE
' strFileName should be full path
' and filename
' i.e. "C:\Temp\MyFile.xls"
'/===============================/
'
Public Function FileExists(strFileName As String) _
As Boolean
On Error GoTo err_Function

FileExists = False
If Dir(strFileName) < "" Then
FileExists = True
End If

exit_Function:
On Error Resume Next
Exit Function

err_Function:
Debug.Print "Error: " & Err.Number & " - (" & _
Err.Description & _
") - Function: FileExists - Module: " & _
"Mod_Functions_FileExists - " & Now()
GoTo exit_Function

End Function
'/===============================/


--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"carmjo005" wrote:

Is there a way to search a SharePoint site to see if a Workbook exists? I
have CanCheckOut working, but the problem is that if the workbook is already
checked-out or if it doesn't exist I think I get the same response(can't
checked-out). If the Workbook is already checked-out then I will display a
message "The file is already checked out. Try again later". However, if the
file does not exits then I want to search for an earlier file.
Thanks for your time and expertice in advance

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Search SharePoint for Workbook


Thanks Gary. I've tried something similar but just can't get "Dir" to work
within SharePoint(even with your code). My path and filename are correct and
work fine with Open(read-only), CanCheckOut and CanCheckIn. Used a work
around to first try to Open the workbook which generates no error if it
exists - seems to work but sloppy
Appreciate your help

"Gary Brown" wrote:

Here's a User-Defined-Function that might help...

'/===============================/
' Function Purpose:
' Return TRUE or FALSE
' strFileName should be full path
' and filename
' i.e. "C:\Temp\MyFile.xls"
'/===============================/
'
Public Function FileExists(strFileName As String) _
As Boolean
On Error GoTo err_Function

FileExists = False
If Dir(strFileName) < "" Then
FileExists = True
End If

exit_Function:
On Error Resume Next
Exit Function

err_Function:
Debug.Print "Error: " & Err.Number & " - (" & _
Err.Description & _
") - Function: FileExists - Module: " & _
"Mod_Functions_FileExists - " & Now()
GoTo exit_Function

End Function
'/===============================/


--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"carmjo005" wrote:

Is there a way to search a SharePoint site to see if a Workbook exists? I
have CanCheckOut working, but the problem is that if the workbook is already
checked-out or if it doesn't exist I think I get the same response(can't
checked-out). If the Workbook is already checked-out then I will display a
message "The file is already checked out. Try again later". However, if the
file does not exits then I want to search for an earlier file.
Thanks for your time and expertice in advance

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
Excel hyperlink within workbook and SharePoint drafts Scott VanDelinder Excel Discussion (Misc queries) 2 May 20th 10 05:25 AM
Sharepoint: How do I upload Excel (2003) Reports to Sharepoint? [email protected] Excel Programming 0 January 29th 09 11:34 AM
Excel links & SharePoint 3.0 (worked fine with SharePoint 2.0) ScottFisher2004 Excel Discussion (Misc queries) 0 November 10th 08 03:26 PM
Sharing a workbook in Sharepoint or another web-based doc mgmt sys Bob W Excel Discussion (Misc queries) 0 October 29th 07 03:25 PM
SharePoint instead of Share Workbook? Gregg Excel Discussion (Misc queries) 0 May 16th 05 11:58 PM


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