Results 1 to 12 of 12

Thread: Rationalize my import / export code

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Answer to your questions:

    1. It is making the other workbook active, you just can't see it because you have set ScreenUpdating to false. (set screenupdating to true then run your code to confirm this)

    2. What is this piece of code supposed to do? The "With TWB" part is doing nothing because you keep referring to "ThisWorkbook".


    With TWB 
        Set VBComp = ThisWorkbook.VBProject.VBComponents("frmsavewr") 
        ThisWorkbook.VBProject.VBComponents.Remove VBComp 
        Set VBComp = ThisWorkbook.VBProject.VBComponents("frmsavecr") 
        ThisWorkbook.VBProject.VBComponents.Remove VBComp 
        Set VBComp = ThisWorkbook.VBProject.VBComponents("Mdl_Sendmail") 
        ThisWorkbook.VBProject.VBComponents.Remove VBComp 
        Set VBComp = ThisWorkbook.VBProject.VBComponents("Mdl_spellcheck") 
        ThisWorkbook.VBProject.VBComponents.Remove VBComp 
        Set VBComp = ThisWorkbook.VBProject.VBComponents("Mdl_Toolbar") 
        ThisWorkbook.VBProject.VBComponents.Remove VBComp 
    End With

    Another general note. Get rid of the "On Error Resume Next". This is not helping you debug your code. Chances are, Excel will tell you where you problem is if you don't tell it to ignore the errors.
    Last edited by Aussiebear; 12-21-2024 at 05:18 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •