+ Reply to Thread
Results 1 to 7 of 7

Object not available + can't find project or library errors

  1. #1
    Registered User
    Join Date
    01-10-2014
    Location
    Ottawa, Canada
    MS-Off Ver
    2010, 2013, 2016
    Posts
    7

    Object not available + can't find project or library errors

    I am encountering the following two error messages immediately upon running my excel VBA application on a customer's system:
    - "Could not load an object because it is not available on this machine", followed by
    - "Compile error: Can't find project or library"

    The application runs just fine on all other systems that I have run it on (Excel 2010 and 2013). The only obvious difference between my customer's system and others is that they are using the 64 bit version of Excel. When I first tried to run it on their system, I received error messages related to API function declarations but I have since fixed that (I think!) by providing both 32 bit and 64 bit versions using the code suggested here: http://www.jkp-ads.com/Articles/apideclarations.asp and a conditional compile using #If VBA 7 then ... #Else ... #End If. This eliminated the declare errors but then these other two errors popped up. In case it is relevant, the API functions I am using are: getFrequency, getTickCount, SendMessage, GetDeviceCaps, GetDC, and ReleaseDC.

    I have tried what I understand to be the usual ways to solve this but with no luck, e.g.:
    - viewing references in the VBA editor on their system shows all the expected references are checked off and none are flagged as MISSING
    - I had the customer turn off a couple of COM add-ins that they had active, but no change
    - I had the customer confirm that all windows updates have been installed
    - I sent them a basic .xlsm file that just copied a value from one worksheet cell to another when a button was pushed, and that worked fine on their end

    At this point I'm not sure what to try next. Any suggestions for other things to try out? Is there any way to find out what specific objects, projects or libraries are causing the problem? Any thoughts would be appreciated, and let me know if I should provide more details. Thanks.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Object not available + can't find project or library errors

    Hi iswehr an welcome to Excel Forum,

    My speculation is that you are using a Date Picker control that requires Active X library MSCOMCT2.OCX. To the best of my knowledge that library is NOT AVAILABLE for use with 64 bit Excel. There are numerous alternatives available that don't require the library. For additional information see:
    http://www.logicwurks.com/CodeExampl...erControl.html
    http://excelribbon.tips.net/T002080_...te_Picker.html

    Lewis

  3. #3
    Registered User
    Join Date
    01-10-2014
    Location
    Ottawa, Canada
    MS-Off Ver
    2010, 2013, 2016
    Posts
    7

    Re: Object not available + can't find project or library errors

    Hi Lewis - thanks for the suggestion, and for the welcome! We don't actually use a date picker active X control anywhere in our application (we've tried to avoid Active X controls in favour of form controls). Feels like you might be on the right track though ... do you know if there are other controls, etc. where a similar 64 bit conflict might exist? For instance, we use the SendMessage, GetDeviceCaps, GetDC, and ReleaseDC API functions I mentioned in the original post to create an interactive branching tree structure view in some of our userforms that requires MSCOMCTL.OCX My customer's system doesn't flag that library as missing, but perhaps there are still differences causing a conflict?

    -Stephan

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Object not available + can't find project or library errors

    the API functions I am using are: getFrequency, getTickCount, SendMessage, GetDeviceCaps, GetDC, and ReleaseDC.
    I checked all of these, and they are in standard libraries. The 64 bit Excel declarations I found for them are:

    Please Login or Register  to view this content.
    We don't actually use a date picker active X control anywhere in our application (we've tried to avoid Active X controls in favour of form controls).
    Good idea. I also avoid 'Active X', unless there is absolutely no other viable alternative.


    I am encountering the following two error messages immediately upon running my excel VBA application on a customer's system:
    - "Could not load an object because it is not available on this machine", followed by
    - "Compile error: Can't find project or library"
    For instance, we use the SendMessage, GetDeviceCaps, GetDC, and ReleaseDC API functions I mentioned in the original post to create an interactive branching tree structure view in some of our userforms that requires MSCOMCTL.OCX My customer's system doesn't flag that library as missing, but perhaps there are still differences causing a conflict?

    The only other thing I can think of is the December 14th, 2014 Microsoft update that caused 'Active X' problems. This is unrelated to API. I was under the impression that MSCOMCT2.OCX DOES use 'Active X'.

    See the following. It was originally an 'Active X' problem ONLY, to the best of my knowledge.
    https://support.microsoft.com/en-us/kb/3025036/
    http://blogs.technet.com/b/the_micro...-updates-.aspx

    Removing the .exd files fixed the problem on my computers.

    ----------------------------
    I am out of ideas after this. Since, I don't have 64 bit Excel, I can't offer to test it for you. Good luck.

    Lewis
    Last edited by LJMetzger; 04-24-2015 at 03:03 PM. Reason: Added additional comments re Dec 14th Microsoft update

  5. #5
    Registered User
    Join Date
    01-10-2014
    Location
    Ottawa, Canada
    MS-Off Ver
    2010, 2013, 2016
    Posts
    7

    Re: Object not available + can't find project or library errors

    Thanks for the additional ideas and looking into those items - appreciate the effort. I'll take a look at these and cross-check my declarations with the ones you have posted. Thanks again.

    -Stephan

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Object not available + can't find project or library errors

    You can't use the common controls library in 64bit Office, I'm afraid.
    Remember what the dormouse said
    Feed your head

  7. #7
    Registered User
    Join Date
    01-10-2014
    Location
    Ottawa, Canada
    MS-Off Ver
    2010, 2013, 2016
    Posts
    7

    Re: Object not available + can't find project or library errors

    Ahh - I guess that's the culprit then. I see now that this incompatibility is confirmed at https://msdn.microsoft.com/en-us/lib...nCompatibility

    Looks like there are some non-active x alternatives to Treeview available (e.g. http://www.jkp-ads.com/articles/treeview.asp ). Will have to look into that. Thanks to you both for helping to track down this issue.

    - Stephan

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Name conflicts with existing Module, project or object library
    By pjwhitfield in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-16-2015, 09:56 AM
  2. Can't find project or library - MS Forms 2.0 Ojbect Library
    By RTSmith in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-11-2012, 06:51 PM
  3. Can't find Project or Library
    By ExcelWombat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-09-2010, 02:57 AM
  4. [SOLVED] Outlook Express Object Library missing - needed for Excel 2000 VBA project
    By Steven Bazeley in forum Excel General
    Replies: 1
    Last Post: 04-10-2006, 04:10 AM
  5. [SOLVED] Can't find project or library
    By salut in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2006, 06:15 PM

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