• registering .dll with VBA

    Author
    Topic
    #356728

    Is it possible to run regsvr32.exe within Word VBA in .dot file to register a .dll using Word 97 SR2/WinNT? What code could I use to invoke it?

    I am using a .dll in a form that a few users have not had registered on their workstations. Ideas are appreciated. Thanks.

    Viewing 0 reply threads
    Author
    Replies
    • #528501

      Do the users even have the DLL on their PC’s? You might want to think about using the Package And Deployment Wizard that comes with Office Developer. I believe it will install and register the necessary DLL’s you use in your VBA project(s).

      • #528502

        Thanks for responding. They do have the .dll. It isn’t self-registering and I’m looking for a way to register it as part of the initialization of my template, if possible.

      • #528656

        I am testing using the shell command in VBA to run a batch file to check if a .dll is on the workstation, copy it down if it isn’t, and register it (I don’t have Developer addition). It seems to work so far. Any dangers I might be overlooking? Thanks!

        • #528856

          I cringe when resorting to using SHELL. Since it runs asynchronously, it can get tricky attempting to figure out if whatever you shelled out to do actually worked or not. There’s gotta be a better way than shelling out. Perhaps someone else in this forum has a better idea.

          • #528914

            Lookup the FileSystemObject in help. You can use it to do a search for the file and even iterate through folders. Also lookup FileCopy. Both of those run from VBA. You’re on your own with regsvr32.

            • #529036

              Thank you. I did give up using Shell because it was just too scary. Worked but felt totally out of control. I obviously need to research this further for the future, but for now I found only one user who needed the .dll registered and used regsrv32.exe at the workstation to take care of it. Thanks again. These forums are invaluable.

    Viewing 0 reply threads
    Reply To: registering .dll with VBA

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: