Workbook opens but I still get a VBA Subscript out of range error

前端 未结 1 1054
傲寒
傲寒 2021-01-28 03:57

I\'m trying to open a workbook through my marco script and I have this error recurring everytime I try to open a workbook. The problem I\'m facing is that when I use

<         


        
相关标签:
1条回答
  • 2021-01-28 04:18

    If you want to use a workbook opened with vba, you need to Set a reference to it, like so

    Dim wb as Workbook
    Set wb = Workbooks.Open(string of path and filename)
    

    Then you can go on referencing the Workbook object, wb and use its methods and refer to its properties.

    0 讨论(0)
提交回复
热议问题