+ Reply to Thread
Results 1 to 5 of 5

Runtime Error '1004' - but different

  1. #1
    Registered User
    Join Date
    10-26-2007
    Posts
    27

    Runtime Error '1004' - but different

    Hi,

    I am a newby to VBA and copied a VBA macro to my Excel to test.

    The PARTIAL code is:
    Please Login or Register  to view this content.
    Now, I run this and get a runtime error on the last line in this example . I have all the references set according to the directions, but this keeps coming up .

    Please help me understand why this happens .

    Also, this is posted at Tek-Tips
    (http://www.tek-tips.com/viewthread.c...1421046&page=1) but I cannot get anyone to finalize an answer.

    P.S. The code is at http://www.tek-tips.com/faqs.cfm?fid=5757 and was from Wallenbach originally - per the post.

    Thanks
    E

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    Try

    Please Login or Register  to view this content.
    as an alternative.
    Martin

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Is the VBIDE library open?
    I think that the VBEditor.MainWindow is only avaliable through the VBIDE.

    From the VBEditor Tools menu> References, the
    Microsoft Visual Basic for Application Extensibility library should be open.

    (This is from memory, a slightly different name may be what you see.)

  4. #4
    Registered User
    Join Date
    10-26-2007
    Posts
    27

    Question

    OK, tried the Application.ScreenUpdating = False. Did not work. Well, did get past this but still getting an error on the next line which also has to do with VBProject.

    Yes, VB Extensions are on - well they show up in the VBE-> References screen.

    Also, what area in VBE do I put this coding?

    Still trying to figure this out as I have a project I will be involved in that may use this type of coding/macro.

    Please help

    If I need to put more info in, let me know.

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    When you open the VBEditor and select References from the Tools menu a dialog box should appear. Is the
    Microsoft Visual Basic for Applications Extensibility library checked?
    If not, check the box and press OK.

    That's Done!

    If you are writting code for distribution, you'll need to include code that opens the user's VBIDE library.

    What are you doing with this?

    If you are creating and destroying UserForms, people can give you a lot of reasons why that is usualy a bad idea. (My favorite argument against that practice is that it makes your file grow larger with each use.)

    Is your VB routine writting code to a module?

    (If you need to keep the VBE window invisible, you must be doing something unusual (i.e. interesting).)

+ 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