简体   繁体   中英

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM