vba script hangs at Workbook.Close

前端 未结 2 1980
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-18 09:26

I am trying to write a hello world application in Visual Basic for Applications, namely, to modify a cell in an Excel sheet. Here it is:

Sub hello()

    Dim         


        
2条回答
  •  情书的邮戳
    2021-01-18 09:31

    It should be

    Workbooks.Close
    

    I also think that "Workbook" is a reserved word and you should use something like "wb" instead.

    Dim wb As Workbook
    

提交回复
热议问题