VBA Workbook.Open(File) returns Nothing

后端 未结 2 1028
清酒与你
清酒与你 2020-12-22 10:54

EDIT: After lots of help and not having a clue what\'s going on, it worked using a different method of opening (see @JohnMuggin\'s help below)--so I un-

2条回答
  •  醉酒成梦
    2020-12-22 11:23

    And at the very last try this little sub. If it doesn't open your workbook then there is a problem with the path or filename

    Sub opendfghj()
    
    Dim wb As Workbook
    
    Workbooks.Open Filename:="C:\Users\User\Desktop\Templates and Example data\Repeat Tests\file.xlsx"
    
    Set wb = ActiveWorkbook
    
    wb.Worksheets("Sheet1").Range("A1") = "It Works"
    End Sub
    

提交回复
热议问题