+ Reply to Thread
Results 1 to 6 of 6

re: Automatically Delete WorkBook 2 modules by using Workbook 1 module

  1. #1
    ddiicc
    Guest

    re: Automatically Delete WorkBook 2 modules by using Workbook 1 module

    Hi All,
    I have still cannot get it right after some advice from Norman and other
    experts.

    I would like to write a macro and put it in Workbook 1. This macro in
    workbook 1
    will help mi to delete all the modules in Workbook 2.

    Eg.
    Workbook 2 modules are 1) "A_SortData", 2) "B_CreateMonthlyYield"

    So what can anybody tell me what to write for the macro to place in workbook
    1
    to delete the 2 modules stated above in workbook 2???



  2. #2
    Dave Peterson
    Guest

    Re: Automatically Delete WorkBook 2 modules by using Workbook 1 module

    Did Norman or others point you to Chip Pearson's site:
    http://www.cpearson.com/excel/vbe.htm

    Chip has lots of sample code and tips there.

    ddiicc wrote:
    >
    > Hi All,
    > I have still cannot get it right after some advice from Norman and other
    > experts.
    >
    > I would like to write a macro and put it in Workbook 1. This macro in
    > workbook 1
    > will help mi to delete all the modules in Workbook 2.
    >
    > Eg.
    > Workbook 2 modules are 1) "A_SortData", 2) "B_CreateMonthlyYield"
    >
    > So what can anybody tell me what to write for the macro to place in workbook
    > 1
    > to delete the 2 modules stated above in workbook 2???


    --

    Dave Peterson

  3. #3
    ddiicc
    Guest

    Re: Automatically Delete WorkBook 2 modules by using Workbook 1 mo

    Hi Dave,
    Yes Norman point me to the website, I try but an error occur on
    the VBComponent Definition

    Tony

    "Dave Peterson" wrote:

    > Did Norman or others point you to Chip Pearson's site:
    > http://www.cpearson.com/excel/vbe.htm
    >
    > Chip has lots of sample code and tips there.
    >
    > ddiicc wrote:
    > >
    > > Hi All,
    > > I have still cannot get it right after some advice from Norman and other
    > > experts.
    > >
    > > I would like to write a macro and put it in Workbook 1. This macro in
    > > workbook 1
    > > will help mi to delete all the modules in Workbook 2.
    > >
    > > Eg.
    > > Workbook 2 modules are 1) "A_SortData", 2) "B_CreateMonthlyYield"
    > >
    > > So what can anybody tell me what to write for the macro to place in workbook
    > > 1
    > > to delete the 2 modules stated above in workbook 2???

    >
    > --
    >
    > Dave Peterson
    >


  4. #4
    Rowan
    Guest

    Re: Automatically Delete WorkBook 2 modules by using Workbook 1 mo

    Did you set the reference to the VBA Extensibility library. Tools >
    References > check "Microsoft Visual Basic For Applications Extensibility" in
    Excel 97 or "Microsoft Visual Basic For Applications Extensibility 5.3" in
    Excel 2000 or later.

    "ddiicc" wrote:

    > Hi Dave,
    > Yes Norman point me to the website, I try but an error occur on
    > the VBComponent Definition
    >
    > Tony
    >
    > "Dave Peterson" wrote:
    >
    > > Did Norman or others point you to Chip Pearson's site:
    > > http://www.cpearson.com/excel/vbe.htm
    > >
    > > Chip has lots of sample code and tips there.
    > >
    > > ddiicc wrote:
    > > >
    > > > Hi All,
    > > > I have still cannot get it right after some advice from Norman and other
    > > > experts.
    > > >
    > > > I would like to write a macro and put it in Workbook 1. This macro in
    > > > workbook 1
    > > > will help mi to delete all the modules in Workbook 2.
    > > >
    > > > Eg.
    > > > Workbook 2 modules are 1) "A_SortData", 2) "B_CreateMonthlyYield"
    > > >
    > > > So what can anybody tell me what to write for the macro to place in workbook
    > > > 1
    > > > to delete the 2 modules stated above in workbook 2???

    > >
    > > --
    > >
    > > Dave Peterson
    > >


  5. #5
    ddiicc
    Guest

    Re: Automatically Delete WorkBook 2 modules by using Workbook 1 mo

    Hi Rowan,
    Nope, How to set it? What does it do or help or stand for?

    "Rowan" wrote:

    > Did you set the reference to the VBA Extensibility library. Tools >
    > References > check "Microsoft Visual Basic For Applications Extensibility" in
    > Excel 97 or "Microsoft Visual Basic For Applications Extensibility 5.3" in
    > Excel 2000 or later.
    >
    > "ddiicc" wrote:
    >
    > > Hi Dave,
    > > Yes Norman point me to the website, I try but an error occur on
    > > the VBComponent Definition
    > >
    > > Tony
    > >
    > > "Dave Peterson" wrote:
    > >
    > > > Did Norman or others point you to Chip Pearson's site:
    > > > http://www.cpearson.com/excel/vbe.htm
    > > >
    > > > Chip has lots of sample code and tips there.
    > > >
    > > > ddiicc wrote:
    > > > >
    > > > > Hi All,
    > > > > I have still cannot get it right after some advice from Norman and other
    > > > > experts.
    > > > >
    > > > > I would like to write a macro and put it in Workbook 1. This macro in
    > > > > workbook 1
    > > > > will help mi to delete all the modules in Workbook 2.
    > > > >
    > > > > Eg.
    > > > > Workbook 2 modules are 1) "A_SortData", 2) "B_CreateMonthlyYield"
    > > > >
    > > > > So what can anybody tell me what to write for the macro to place in workbook
    > > > > 1
    > > > > to delete the 2 modules stated above in workbook 2???
    > > >
    > > > --
    > > >
    > > > Dave Peterson
    > > >


  6. #6
    Chip Pearson
    Guest

    Re: Automatically Delete WorkBook 2 modules by using Workbook 1 mo

    You need to set a reference to the Extensibility library. In VBA,
    go to the Tools menu, choose References, and scroll down to
    "Microsoft Visual Basic For Applications Extensibility Library".
    Check this entry in the list.

    This library defines all the data types used in the VBA object
    model, such as VBComponent. Without a reference to the library,
    VBA doesn't know what a VBComponent is, and can't compile the
    code.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "ddiicc" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Rowan,
    > Nope, How to set it? What does it do or help or stand for?
    >
    > "Rowan" wrote:
    >
    >> Did you set the reference to the VBA Extensibility library.
    >> Tools >
    >> References > check "Microsoft Visual Basic For Applications
    >> Extensibility" in
    >> Excel 97 or "Microsoft Visual Basic For Applications
    >> Extensibility 5.3" in
    >> Excel 2000 or later.
    >>
    >> "ddiicc" wrote:
    >>
    >> > Hi Dave,
    >> > Yes Norman point me to the website, I try but an error occur
    >> > on
    >> > the VBComponent Definition
    >> >
    >> > Tony
    >> >
    >> > "Dave Peterson" wrote:
    >> >
    >> > > Did Norman or others point you to Chip Pearson's site:
    >> > > http://www.cpearson.com/excel/vbe.htm
    >> > >
    >> > > Chip has lots of sample code and tips there.
    >> > >
    >> > > ddiicc wrote:
    >> > > >
    >> > > > Hi All,
    >> > > > I have still cannot get it right after some advice from
    >> > > > Norman and other
    >> > > > experts.
    >> > > >
    >> > > > I would like to write a macro and put it in Workbook 1.
    >> > > > This macro in
    >> > > > workbook 1
    >> > > > will help mi to delete all the modules in Workbook 2.
    >> > > >
    >> > > > Eg.
    >> > > > Workbook 2 modules are 1) "A_SortData", 2)
    >> > > > "B_CreateMonthlyYield"
    >> > > >
    >> > > > So what can anybody tell me what to write for the macro
    >> > > > to place in workbook
    >> > > > 1
    >> > > > to delete the 2 modules stated above in workbook 2???
    >> > >
    >> > > --
    >> > >
    >> > > Dave Peterson
    >> > >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1