Open File Without Calling Filepath

后端 未结 5 1367
太阳男子
太阳男子 2021-02-05 15:04

I\'m using excel VBA. I want to press a button that opens another file directly without the effect of \"choosing file window\".

This is the current code:



        
5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-05 15:45

    If it is in the same folder, then

    Workbooks.Open("ObsReportExcelWorkbook.xlsx")
    

    or

    Workbooks.Open(".\ObsReportExcelWorkbook.xlsx")
    

    should work. I just tried both in Excel VBA, with success.

提交回复
热议问题