This is my first post at Mr. Excel but I appreciate all the help I've received just doing searches. Alas, I'm not able to find an answer to this next question, possibly because I don't know the right words to use.
Here's my dilemma, and then I'll post the code.
In this part of our process:
I created a macro to see how Excel would code it (see below), but each time we edit the file, the location will change because it's a different job or perhaps a different client. Here is the macro "closefile".
Macro
<code>Sub CloseFile()
'
' CLOSEFILE Macro
' CLOSES THE FILE IN THE SAME LOCATION AS THE XLS...HOPEFULLY
'
' Keyboard Shortcut: Ctrl+Shift+I
'
ChDir _
**"Z:\@Client Jobs\House\13579\Folder 3"**
ActiveWorkbook.SaveAs fileName:= _
**"Z:\@Client Jobs\House\13579\Folder 3\13579.stage.csv"** _
, FileFormat:=xlCSV, CreateBackup:=False
End Sub
End of Macro
</code>Any suggestions on how we can export the csv to the same directory that we start from when we edit the .xlsx?
Rico
<code></code>
Here's my dilemma, and then I'll post the code.
In this part of our process:
- we edit an .xlsx file,
- then export it as a .csv
- then save it to the same directory where the .xlsx is located.
I created a macro to see how Excel would code it (see below), but each time we edit the file, the location will change because it's a different job or perhaps a different client. Here is the macro "closefile".
Macro
<code>Sub CloseFile()
'
' CLOSEFILE Macro
' CLOSES THE FILE IN THE SAME LOCATION AS THE XLS...HOPEFULLY
'
' Keyboard Shortcut: Ctrl+Shift+I
'
ChDir _
**"Z:\@Client Jobs\House\13579\Folder 3"**
ActiveWorkbook.SaveAs fileName:= _
**"Z:\@Client Jobs\House\13579\Folder 3\13579.stage.csv"** _
, FileFormat:=xlCSV, CreateBackup:=False
End Sub
End of Macro
</code>Any suggestions on how we can export the csv to the same directory that we start from when we edit the .xlsx?
Rico
<code></code>