Link to home
Start Free TrialLog in
Avatar of schwientekd
schwientekdFlag for United States of America

asked on

Delete Excel Macro Vbscript

I have a vbscript to import an excel macro but I realize that I need to first delete the macro before I import it.  The import script is listed below.  What line do I need to add to delete the macro?

Dim oXL, oBook, oSheet

    ' Create a new instance of Excel and make it visible.
    Set oXL = CreateObject("Excel.Application")
    oXL.Visible = True

    ' Add a new workbook and set a reference to Sheet1.
     Set oBook = oXL.Workbooks.Open(oxL.startuppath & "\Personal.xlsb")
     Set oSheet = oBook.Sheets(1)

    'Import previously created BAS module file
     oXL.VBE.ActiveVBProject.VBComponents.Import "C:\Macros\import\Module1.bas"
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial