Forum Discussion
Barry_R
Oct 06, 2022Copper Contributor
Access Export file name with userprofile variable
Does anyone know if there is a way to set an export file name, in an export macro, based on the windows login ID location. Something like C:\users\%userprofile%\........ so it saves to each particu...
arnel_gp
Oct 06, 2022Iron Contributor
can you create a Function that will return you the Path + filename:
in a Module, add this code:
Public Function MyDocumentFile(ByVal filName As String) As String
MyDocumentFile = Environ$("userprofile") & "\documents\" & filName
End Function
then you can call the function from your Macro:
AdamLong
Nov 04, 2022Copper Contributor
Extremely helpful! - much gratitude for your insightful example!