Cheesecube
05-16-2020, 07:15 AM
Hi, I have a file located at C:\A\B\C\macro.xlsm
I want to save my data to C:\A\B\D\save.xlsx
So I use the string ThisWorkbook.Path & "\..\D\save.xlsx"
with a \..\ to move one level up
I used a MsgBox to confirm that the string is "C:\A\B\C\..\D\save.xlsx"
Somehow, when I use the SaveAs function, it says it cannot access the file C:\A\B\D\9CD78...
or something like this. Run-time error 1004
Every time I run it the save location is replaced with some random hexadecimal code
What went wrong and how do I make this SaveAs function work?
I want to save my data to C:\A\B\D\save.xlsx
So I use the string ThisWorkbook.Path & "\..\D\save.xlsx"
with a \..\ to move one level up
I used a MsgBox to confirm that the string is "C:\A\B\C\..\D\save.xlsx"
Somehow, when I use the SaveAs function, it says it cannot access the file C:\A\B\D\9CD78...
or something like this. Run-time error 1004
Every time I run it the save location is replaced with some random hexadecimal code
What went wrong and how do I make this SaveAs function work?