View Single Post
 
Old 11-01-2022, 08:31 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I would recommend that you place the csv file in the same folder as the template since one is only useful with the other. Then you can use the location of the template to get the folder name.
Code:
ThisDocument.Path & Application.PathSeparator & "Roster.csv"
If you desperately want to store the csv in the Documents path and not relative to the template then you can try this method
Code:
  Dim wshShell As Object, sDocPath As String
  Set wshShell = CreateObject("WScript.Shell")
  sDocPath = wshShell.SpecialFolders("MyDocuments") & Application.PathSeparator & "Roster.csv"
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote