View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
nancy drew nancy drew is offline
external usenet poster
 
Posts: 1
Default Why cant I get the path to the sharepoint library????????

I have a custom excel content type and am attempting to create a unique file name

Sub SaveByDate()
Dim MyFileName As String
MyFileName = "PO_" & Format(Now(), "yyyymmdd-hhnnss")
ActiveWorkbook.SaveAs Filename:=MyFileName
End Sub

HOWEVER when I change the name it wants to save to MY DESKTOP and not the DOCUMENT LIBRARY - how can I grab the path? (DO I REALLY HAVE TO HARD CODE THIS???)

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI Then
SaveByDate
End If
End Sub