Ryan Gillooly
Ryan Gillooly

Reputation: 315

Initial Excel Workbook Path

I have an excel spread sheet which, after 30 seconds, saves itself as a new file on the desktop so the original file is not edited. I want the path of the original file, so i add -

"ActiveWorkbook.Path"

But, this doesnt work correctly now, as when the file is saved as a new name after 30 seconds, it takes the

"ActiveWorkbook.Path"

of the newley named file, which in this case is the desktop.

Is there anyway in getting the Path to the initial file, before it got saved ?

Upvotes: 0

Views: 94

Answers (1)

SS781
SS781

Reputation: 2649

I would try to store it in a variable at the start of the code:

Dim originalPath As String
originalPath = ActiveWorkbook.Path

Then, you can refer back to it as needed.

Upvotes: 1

Related Questions