简体   繁体   中英

Saving a file to dynamic path which is a value in Excel cell

I have a vba code in PowerPoint which saves the file automatically with the name of an Excel file which is active.

 PowerPointApp.ActivePresentation.SaveAs "Z:\05_PROJECT\Tanverdi\" & Replace(ThisWorkbook.Name, "xlsm", "ppt"), 1

Different people are going to use this macro and they all have different folders that they are using. So i want the path of the folder to be dynamic too. The best solution would be getting the path name from my active Excel cell, so that they can write the path name in an Excel cel and then I can use this cell value as a path.

But how could I do this ?

假设路径在 Sheet1/Cell A1 中,请将您的硬编码路径替换为:

PowerPointApp.ActivePresentation.SaveAs ThisWorkbook.Sheets(1).Range("A1").Value & Replace(ThisWorkbook.Name, "xlsm", "ppt"), 1

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