Excel's fullname property with OneDrive

后端 未结 12 2003
别那么骄傲
别那么骄傲 2020-12-24 10:12

If I want to use the open Workbook object to get the fullname of an Excel file after saving it, but that file has been synchronized to OneDrive, I get a \"https\" address in

12条回答
  •  滥情空心
    2020-12-24 10:27

    I have the same problem as you. But I have solved that problem. The first I turn off OneDrive before I running the script.

    you can add this script on the first script into your vba/module:

    Call Shell("cmd.exe /S /C" & "%LOCALAPPDATA%\Microsoft\OneDrive\OneDrive.exe /shutdown")
    

    and then, on your last script on your vba/module you can insert this for activate your OneDrive:

    Call Shell("cmd.exe /S /C" & "start %LOCALAPPDATA%\Microsoft\OneDrive\OneDrive.exe /background")
    

    I am using Windows10 on that script.

提交回复
热议问题