+ Reply to Thread
Results 1 to 10 of 10

32 bit Library DLL 'olepro32.dll' vs 64 bit Library 'oleaut32.dll'

  1. #1
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    32 bit Library DLL 'olepro32.dll' vs 64 bit Library 'oleaut32.dll'

    Below is a code that I have pieced together from various sources to do just what I need it to do. Works wonders on a 32 bit system. When I went to a diff PC that was 64 I ran into errors, worked through them and got 90% of the way there... still running into issues. The commented out Declare statements are the alternate versions for 64 bit. The issue comes in on the oleaut32.dll, this is the olepro32 file to be used in the 64 bit environment. However, the Ipic is still causing some memory issues and I am at a loss on where to go from here. Direction and/or solution would be wonderful.

    BTW - this is the work around for exporting Images directly out of Excel. I do this to embed actual images in emails without the need of 3rd party software to maintain HighRes and visibility on mobile devices.

    Please Login or Register  to view this content.
    Last edited by ELeGault; 12-13-2014 at 09:47 PM. Reason: Title update includes DLL references
    -If you think you are done, Start over - ELeGault

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

    Re: 32 bit Library DLL 'olepro32.dll' vs 64 bit Library 'oleaut32.dll'

    Hi,

    The code below is from http://www.jkp-ads.com/Articles/apideclarations.asp

    32 bit:
    Please Login or Register  to view this content.



    64 bit (differences from your code are in red):
    Please Login or Register  to view this content.
    Your 'GUID' declaration should be the same for 32 bit and 64 bit as far as my research could tell.

    It seems like 'GUID' and 'IPicture' are predefined types as the debugger automatically provides capitalization with its IntelliNonSense. My speculation is that you are OK with 'GUID' and 'IPicture' as is.

    GUID reference: http://support.microsoft.com/kb/176790

    IPicture reference: http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx

    Lewis

  3. #3
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: 32 bit Library DLL 'olepro32.dll' vs 64 bit Library 'oleaut32.dll'

    Interesting not home currently but when I get the chance I will check this out further, thanks for the response Lewis and I will let you know the outcome when I get the chance to test it out!!

    Thanks again

  4. #4
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: 32 bit Library DLL 'olepro32.dll' vs 64 bit Library 'oleaut32.dll'

    Still getting an 'Out of Memory' Error -

    Here is a sample file with it working for 32 bit systems.

    TestImageExport.xlsm


    What is odd is that I have a win7 enterprise edition 64 bit that can also run it under the 32bit settings...both running office 2013 which makes this an even bigger headache...

    The desktop running Win7 enterprise 64 bit is the one that runs all of my automated reports and is causing the headache when it comes to Images. Hopefully having a sample version of the code will clarify any issues in the code.

    Once you update the PATH in Module 2 first line, run the CreateImage Macro from module 1.

    Runs great again in 32bit systems (Desktop 64bit win7) seems to be an issue, but going to confirm this tomorrow on a couple other test PC's.

    Thanks again,

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

    Re: 32 bit Library DLL 'olepro32.dll' vs 64 bit Library 'oleaut32.dll'

    64bit API changes are only necessary if you are running 64bit Office. Even on 64 bit Windows if office is 32 bit you do not need to use the PtrSafe versions. You can use conditional compilation to create code to work on either version - you must make sure all relevant variables are declared as LongPtr when required as well as changing the declarations to be PtrSafe.
    Remember what the dormouse said
    Feed your head

  6. #6
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: 32 bit Library DLL 'olepro32.dll' vs 64 bit Library 'oleaut32.dll'

    Ah - Well that explains why it ran fine on the Laptop and not the Desktop, just confirmed that the Laptop has 32 bit running office while the Desktop is running the 64 bit version.

    Still a nuub in the VBA world so will have to do some homework on Conditional compliation methods and figure out which declarations really need to be PtrSafe/LongPtr. This has been a nightmare building up and seems to be the only way to get a high res image of ranges to export directly out of Excel. Though I am now fighting file sizes... if its not one thing its another. If you are good with Conditional Compilation methods or have solid references, please share or show me where/what I need to do with the current code - I will leave the thread open a bit longer for that as it is the ultimate goal to have it run in the 64 bit environment and/or both.

    I do want to thank you romperstomper for the clarification on why it is working on one and not the other, saved me from pointless testing tomorrow .

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

    Re: 32 bit Library DLL 'olepro32.dll' vs 64 bit Library 'oleaut32.dll'

    This is a very good place to start: http://www.jkp-ads.com/Articles/apideclarations.asp

    It includes a link to a Microsoft page where you can get a download with lots of API declarations for 64bit.

    Your code should be something like this (untested):
    Please Login or Register  to view this content.

  8. #8
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: 32 bit Library DLL 'olepro32.dll' vs 64 bit Library 'oleaut32.dll'

    You both have been a great help, Thank you - Tested and confirmed!

  9. #9
    Registered User
    Join Date
    03-19-2017
    Location
    spain
    MS-Off Ver
    office 2013
    Posts
    6

    Re: 32 bit Library DLL 'olepro32.dll' vs 64 bit Library 'oleaut32.dll'

    Hi, I'm sorry to ask about this old issue, but it is new problem for me and I cant solve it. and i see that was solved
    but not work for me

    In office 2013 32 bit works without problems, in office 64bits 2016 works except when excel arrives to r = OleCreatePictureIndirect (uPicInfo, IID_IDispatch, True, IPic) in the function CreatePicture.
    When copying an image from excel and paste it, it gives me an excel error "olepro32.dll was not found"

    which is the solution?

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

    Re: 32 bit Library DLL 'olepro32.dll' vs 64 bit Library 'oleaut32.dll'

    Hi jcarlos66 and Welcome to ExcelForum,

    In the future please do not ask a question in an old thread. It is a violation of forum rules. Ask the question in a new thread and add a link to the old thread if you think it is necessary.

    I don't have a solution but read the following link which suggests replacing the references to olepro32.dll with oleaut32.dll. https://answers.microsoft.com/en-us/...a-e0246298cb04

    Lewis

+ 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. ADO 2.8 library
    By ravishukla884 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2012, 06:46 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. Use same ADO library again
    By richmoijn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-30-2008, 08:25 AM
  4. DAO library
    By TheIrishThug in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2006, 12:55 AM
  5. Missing library
    By Charles in forum Excel General
    Replies: 0
    Last Post: 10-01-2005, 05:05 AM

Tags for this Thread

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