title: How do I pull the URL/Path of the sharepoint document library I'm in from Excel VB?
body: <p>I would like to set the filename for an item I create in an Excel Document Library. Howeverm when I try to interfere with the standard save with my own filename, it wants to save to my LOCAL MACHINE. I would happily like to supply the PATH if that is necessary, but I really DONT WANT TO HARD CODE IT. </p>
  
  <p>Are there any properties I can use to parse this info? Meta data? Template?</p>
  
  <pre><code>Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
  If SaveAsUI Then
     Sheets("Purchase Order").Range("Description,VendorInfo,QUANTITY1,PRODUCT1,ITEM1,PRICE1,submitter,ShipVia,Terms,MACRO_ALERT").Interior.ColorIndex = xlColorIndexNone
     Sheets("Purchase Order").Range("Location").Interior.Color = RGB(184, 204, 228)
     Sheets("Purchase Order").Range("MACRO_ALERT").Value = ""
  
    Dim MyFileName As String
  Dim MyFilePath As String
  </code></pre>
  
  <p>'     MyFilePath = "http://server/dept/purchasetracking/"
   MyFilePath = Application.Path</p>
  
  <pre><code>  MyFileName = "PO_" &amp; Format(Now(), "yyyymmdd-hhnnss")
    MsgBox (MyFilePath &amp; MyFileName)
  </code></pre>
  
  <p>ActiveWorkbook.SaveAs Filename:=MyFilePath &amp; MyFileName ', FileFormat:=52
      '    ActiveWorkbook.SaveAs Filename:=MyFileName
      End If
  End Sub</p>