I'm trying to save a CSV file that can then be saved on any users desktop. I've been reading through a lot of threads, and I seem to be getting close, but just don't have the right mix!
The code below does exactly what I want...except it saves as a PDF rather than a CSV because it uses the exportasfixedformat object.
I think I need to use 'save as' for a CSV, but I cant work out how to then mix in the "userprofile" command to save regardless of user login.
Private Sub CommandButton1_Click()
Sub SavePDF()
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:= Environ("USERPROFILE") & "\Desktop\Export.pdf", _
OpenAfterPublish:=True
End Sub