Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-01-2022, 08:31 PM
Guessed's Avatar
Guessed Guessed is offline Stop file from going to OneDrive path and using different Environ("username") Windows 10 Stop file from going to OneDrive path and using different Environ("username") 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
  #2  
Old 11-02-2022, 05:47 AM
grNadpa grNadpa is offline Stop file from going to OneDrive path and using different Environ("username") Windows 10 Stop file from going to OneDrive path and using different Environ("username") Office 2016
Advanced Beginner
Stop file from going to OneDrive path and using different Environ("username")
 
Join Date: Mar 2022
Posts: 46
grNadpa is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
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.
I erroneously assumed that templates must go to
Code:
 C:\Users\...\Documents\Custom Office Templates
and that ONLY templates could go there. Silly me.

I'll certainly go with your first suggestion. (Can hardly wait to find out what happens when I attempt updates to that csv file.) Hold good thoughts.
Reply With Quote
Reply

Tags
onedrive, path, windows 10



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003: VBA "Function" causes "#VALUE!" errors after running "insert/delete row" custom macro Matt C Excel Programming 2 01-08-2022 06:03 AM
Lost folders due to using "Root Folder Path" Selien Outlook 0 09-13-2018 03:30 PM
Stop file from going to OneDrive path and using different Environ("username") Error window: "Document name or path is not valid" SKE Word 1 01-28-2016 10:41 PM
Change "File As" and "Display As" format davesp Outlook 0 10-14-2014 12:10 PM
Stop file from going to OneDrive path and using different Environ("username") Adding additional "\" to directory path name jmaxcy Excel 1 10-15-2013 01:42 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:28 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft