Extracting modules from a different workbook via VBA? (corrupt file)
Results 1 to 3 of 3

Thread: Extracting modules from a different workbook via VBA? (corrupt file)

  1. #1
    Board Regular dispelthemyth's Avatar
    Join Date
    Mar 2006
    Location
    England
    Posts
    635
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Extracting modules from a different workbook via VBA? (corrupt file)

    I have a corrupt file that i cant expand the project view on meaning i cant get to the point of seeing the modules and right clicking to export (it is password protecting and i am able to enter the password successfully)

    Is there a way to export these modules using VBA when inside another workbook?
    Financial Modelling Consultant
    Excel 2016 32bit and 2016 64bit + Windows 10

    I've always listening so i'm always learning
    Before posting your question, reread it to make sure you understand it.
    If possible post example data to make it easier to help you

  2. #2
    Board Regular Jaafar Tribak's Avatar
    Join Date
    Dec 2002
    Location
    Larache--Morocco
    Posts
    7,319
    Post Thanks / Like
    Mentioned
    38 Post(s)
    Tagged
    3 Thread(s)

    Default Re: Extracting modules from a different workbook via VBA? (corrupt file)

    Quote Originally Posted by dispelthemyth View Post
    I have a corrupt file that i cant expand the project view on meaning i cant get to the point of seeing the modules and right clicking to export (it is password protecting and i am able to enter the password successfully)

    Is there a way to export these modules using VBA when inside another workbook?
    Have you tried something like this assuming the corrupt excel file and the expoting workbook are both opened in the same excel instance:

    Code:
    Call Workbooks("Book2").VBProject.VBComponents("Module1").Export(...
    Change the items in red to suit.
    Last edited by Jaafar Tribak; Aug 15th, 2019 at 08:07 AM.
    Office/Excel 2010 64Bits -- Win10 64Bits

    Common sense is not so common.


    http://photo-larache.blogspot.com/

  3. #3
    Board Regular dispelthemyth's Avatar
    Join Date
    Mar 2006
    Location
    England
    Posts
    635
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Extracting modules from a different workbook via VBA? (corrupt file)

    Quote Originally Posted by Jaafar Tribak View Post
    Have you tried something like this assuming the corrupt excel file and the expoting workbook are both opened in the same excel instance:

    Code:
    Call Workbooks("Book2").VBProject.VBComponents("Module1").Export(...
    Change the items in red to suit.
    Thank you very much for the helpful code, i've been able to amend it to cycle through all the objects and extract. much appreciated.
    Financial Modelling Consultant
    Excel 2016 32bit and 2016 64bit + Windows 10

    I've always listening so i'm always learning
    Before posting your question, reread it to make sure you understand it.
    If possible post example data to make it easier to help you

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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