Object Required Error when referencing Excel Objects

前端 未结 1 1806
星月不相逢
星月不相逢 2020-12-02 03:10

Below is the VBScript code for deleting the duplicates from one excel workbook and then copying it to another, when I run it I\'m getting an error;

Ob

相关标签:
1条回答
  • 2020-12-02 03:34

    VBScript doesn't support implicit use of the application object. You have to use it explicitly. VBScript also doesn't support named arguments (name:=value) or Excel built-in constants (xlYes). Change this line:

    activesheet.UsedRange.RemoveDuplicates Columns=Array(), Header=xlYes
    

    into this:

    objExcel.ActiveSheet.UsedRange.RemoveDuplicates Array(), 1
    
    0 讨论(0)
提交回复
热议问题