donkey shrek
New Member
- Joined
- Nov 15, 2022
- Messages
- 26
- Office Version
- 365
- Platform
- Windows
Hi all, I am new to VBA & I'm a little confused with this code.
I am trying to rename a file so that it will be uploaded to a shared drive.
Variable oldname has only been used at this instance, which is to assign the old path to it. My main question here is that it's hence, redundant right?
When trying to rename a file, we don't need to reference it by calling out the full file path, we can just use ActiveWorkbook?
I am trying to rename a file so that it will be uploaded to a shared drive.
Variable oldname has only been used at this instance, which is to assign the old path to it. My main question here is that it's hence, redundant right?
When trying to rename a file, we don't need to reference it by calling out the full file path, we can just use ActiveWorkbook?
VBA Code:
oldname = ThisWorkbook.Path & "\CRMS.xlsx"
newname = sharepointpath & "\" & filename & ".xlsx"
ActiveWorkbook.SaveAs newname