+ Reply to Thread
Results 1 to 2 of 2

VBA not able to call from DLL file when the file is saved

  1. #1
    Registered User
    Join Date
    09-20-2013
    Location
    Hartland, WI
    MS-Off Ver
    Excel 2013 Professional Plus
    Posts
    73

    VBA not able to call from DLL file when the file is saved

    Hello, I have an add-in called GeoDesiX. It is a geocoder/mapping tool that uses Google Maps API. It works fine, even on my machine, but I think it was built using 32-bit, while I have 64-bit Excel. When I open the add-in for the first time, an example workbook is below, it works great.

    The problem is, that when I save any file with the map in it, the VBA no longer works, and an error pops up in the below code that says: "Object Reference not set to an instance of an object". This happens at the Err.Raise 65000, "GeodesiX", Result part. It looks like it just cannot find the DLL file, which is the "GeodesiX" in that error part. I was reading that it might be caused by switching between 64 bit and 32 bit, but could not figure out how to do it. I am guessing you need to put Private Function Declare PtrSafe, but I could not figure out syntax on how to get that to work. I understand that you will not be able to use these as it is an add-in, but maybe you just know what I need to do in order for the vba to call to the DLL file.


    Please Login or Register  to view this content.

    Copy of GeodesixVBA.xlsm

  2. #2
    Forum Contributor Gregor y's Avatar
    Join Date
    10-24-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2010 32-Bit
    Posts
    280

    Re: VBA not able to call from DLL file when the file is saved

    Hmm, that sounds like a hard problem to work through and I'm not too sure how much help I'll be; however here are a couple of thoughts I came up with while reading through your post.

    The problem is, that when I save any file with the map in it, the VBA no longer works
    The magic words "no longer works", leads me to believe that it works before the save; which leads me to believe that it is not an issue with the DLL since it does work at some point. Maybe when you save the file the "map" is/has an object that references something that is in the GeoDesiX addin, and that reference is somehow lost/broken when you save the file. (Maybe look at coding the map to be automatically rebuilt in the Workbook_Open event)

    The other though is you may want to change the line of code that reads
    Please Login or Register  to view this content.
    to be
    Please Login or Register  to view this content.
    and then you should be able to see if the function call is being preformed correctly.

    As a side note:
    Please Login or Register  to view this content.
    is an awesome one-liner that I'm going to have to add to my personal canon.

+ 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. [SOLVED] VB to open a file, input on a file and close again, with NO macros/vb saved to file
    By unreal_event_horizon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2012, 11:41 AM
  2. [Ask] Import Text file And Call reference path file with Value Range.
    By dha_indra in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-29-2012, 11:09 PM
  3. Replies: 0
    Last Post: 04-16-2012, 10:57 AM
  4. Replies: 0
    Last Post: 08-17-2005, 11:05 PM
  5. Replies: 4
    Last Post: 02-18-2005, 10:06 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