+ Reply to Thread
Results 1 to 6 of 6

VBA code not working anymore

  1. #1
    Registered User
    Join Date
    05-16-2005
    Posts
    33

    VBA code not working anymore

    I have a large number of workbooks containing vba code. These programs were written in excel 2003 on a windows xp sp3 pc and worked without a problem. One of the references in all programs was to Microsoft DAO 3.6 Object library. All of the programs use userforms which have Common Dialog boxes.

    A while ago, I upgraded to a W7 64 bit machine and installed Office 2003. The programs continued to run without a problem. I then purchased and installed Office 2007 and the programs ran in both excel 2003 and 2007. I had problems with apparent conflicts with Word 2003 and Word 2007 so following advice elsewhere in these forums, I uninstalled Office 2003 and then re-installed excel 2003 only.
    Now none of my programs will run in either version of excel. As soon as I try to run a program, I get "Object library invalid or contains references to object definitions that could not be found". I then checked the Tools/References and see that Microsoft DAO 3.6 Object library is shown as MISSING.

    What has happened to this library? How can I get it back? What caused it to go missing?

    Also the reference for Common Dialog Boxes is not present so I can not create these boxes on new forms.

    Also when I try to save any of these workbooks (to my C drive) I get a "Document not saved" message and the workbook is not saved.

    Can anyone tell me what is going on please

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: VBA code not working anymore

    I would start by searching for and removing any .exd files on your computer (NOT .exe!!)
    the common dialogs don't have anything to do with Office - they are part of windows. you may have a version issue though. (I don't think the reference is actually required in order to use them though)
    can you locate the DAO36.dll on your machine? Office 2007 and later use the Microsoft access database engine rather than DAO3.6 but it should still work if you have the library.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA code not working anymore

    Try unchecking the Missing reference
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    05-16-2005
    Posts
    33

    Re: VBA code not working anymore

    Thanks for your replies.

    I apparently have 2 copies of dao36.dll in:

    C:\Program Files (x86)\Common Files\microsoft shared\DAO

    C:\Windows\winsxs\x86_microsoft-windows-m..s-components-jetdao_31bf3856ad364e35_6.1.7600.16385_none_7b8c1dc4ef873d90


    I found 2 .exd files and deleted them and the problem seems to have gone away, at least in excel 2003. the programs still dont run in excel 2007 but I think that is due to
    the statement
    Selection.Characters(Start:=2, Length:=5).Font.Name = "Arial"
    giving an error but that is a different problem I think.

    Thanks very much for your help.

    By the way what are .exd files and why should they cause a problem?

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: VBA code not working anymore

    .exd files are temp files created when you use activex controls. they can cause problems with version changes so always worth clearing out if you start getting errors like that.

  6. #6
    Registered User
    Join Date
    05-16-2005
    Posts
    33

    Re: VBA code not working anymore

    Thanks again Joseph, I had searched many forums until now and not got any worthwhile help.

+ 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