Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Why cant I get the path to the sharepoint library????????


but my question is about pulling the URL dynamically, without
hardcoding, from the sharepoint document. how do I get that
information in an excel macro??
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Why cant I get the path to the sharepoint library????????

Stefanie expressed precisely :
but my question is about pulling the URL dynamically, without
hardcoding, from the sharepoint document. how do I get that
information in an excel macro??


'ActiveWorkbook.FullName' returns the complete path & filename.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Why cant I get the path to the sharepoint library????????

no it does not. It returns the path to my LOCAL MACHINE and not the
SHAREPOINT DOCUMENT LIBRARY.

Do you have Sharepoint? You can see what I mean if you do.

Create a doc library with Excel Content type. upload a template as a
content type and try to customize the file save as
functionality....let me know if you get the path of the document
library or not.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Why cant I get the path to the sharepoint library????????

What's interesting is that this sort of works - but I'm creating the
doc twice. When I get the Save As dialog - the document already
exists:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If SaveAsUI Then
Sheets("Purchase
Order").Range("Description,VendorInfo,QUANTITY1,PR ODUCT1,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 = ""
SaveByDate
End If
End Sub

Sub SaveByDate()
Dim MyFileName As String
Dim MyFilePath As String
MyFilePath = "http://server/dept/purchasetracking/"
MyFileName = "PO_" & Format(Now(), "yyyymmdd-hhnnss")
ActiveWorkbook.SaveAs Filename:=MyFilePath & MyFileName,
FileFormat:=52
End Sub


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Why cant I get the path to the sharepoint library????????

Stefanie presented the following explanation :
no it does not. It returns the path to my LOCAL MACHINE and not the
SHAREPOINT DOCUMENT LIBRARY.

Do you have Sharepoint? You can see what I mean if you do.

Create a doc library with Excel Content type. upload a template as a
content type and try to customize the file save as
functionality....let me know if you get the path of the document
library or not.


I don't have Sharepoint. I also know nothing about it and so will do
some research.<g

When opening files from my network it shows the UNC path & filename. I
thought this is what you were looking for. Sorry for the interuption!

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


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
Problem with file path to sharepoint John Keith Excel Programming 0 December 8th 10 06:47 AM
Unable to delete file from Sharepoint Server Library using VBA (Ex Net_prof Excel Programming 6 April 8th 08 07:32 PM
Exclude Network Path In PivotTable Based on Sharepoint eduboys Excel Discussion (Misc queries) 1 October 2nd 07 09:43 PM
Issue with Template Wizard and SharePoint Document Library Pandoro Excel Discussion (Misc queries) 0 May 8th 06 03:40 AM
#VALUE error when referencing spreadsheet on sharepoint library Lois Johns Excel Worksheet Functions 2 May 19th 05 05:38 PM


All times are GMT +1. The time now is 07:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"