Simon Lloyd
02-06-2007, 04:09 AM
Could someone explain why using Environ(UserName) in this line causes Runtime Error 5? r1 = "C:\Documents and Settings\" & Environ(UserName) & "\My Documents\Sales Details For " & c.Valueif i substitute it for Simon then it works fine, if i substitute it for Application.UserName then when my function checks for the filepath and then tries to create it because it doesnt exist using MkDir i get Runtime Error 76 filepath not found, thats because Application.UserName returns Simon Lloyd but my log in name to my personal computer is Simon so the real line would look like this
r1="C:\Documents and Settings\Simon\My Documents\Sales Details For " & c.Value Any ideas?
Regards,
Simon
r1="C:\Documents and Settings\Simon\My Documents\Sales Details For " & c.Value Any ideas?
Regards,
Simon