Results 1 to 22 of 22

Thread: VB6 32bits accessing Office 64bits

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2015
    Posts
    472

    VB6 32bits accessing Office 64bits

    Well, on a client site, they are migrating all the Office 32 bits to 64 bits.
    And that could be a problem, as maybe some application written in VB6 are using Outlook/Excel/Word 32 bits, but will be 64 bits.

    So, it will be incompatible with VB6 App.

    Is someone here faced this? Or found a solution?

    My first idea is writing a wrapper in .NET that will access 64 Office, and communicate with VB6 App.
    This will reduce de rewriting of applications.

    I will start to analyze all this, but if someone as an existing solution, it is welcome.

    Thanks

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    4,704

    Re: VB6 32bits accessing Office 64bits

    According to me 32bit applications can not communicate with 64bit applications.
    So we always advice customers to use 32bit versions of MS-Office, if they want to use the modules which rely on MS-Office automation.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2015
    Posts
    472

    Re: VB6 32bits accessing Office 64bits

    I know Arnoutdv, but I think that a .NET Wrapper (in 64 bits) could do the job, then a XMLRPC communication between VB6 & .NET (http://comxmlrpc.sourceforge.net/)
    Or some other way of communication.
    Not yet investigated deeper

  4. #4
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: VB6 32bits accessing Office 64bits

    Quote Originally Posted by Thierry69 View Post
    Well, on a client site, they are migrating all the Office 32 bits to 64 bits.
    That's dumb... Even Microsoft doesn't recommend that.
    Last I checked the default install media was 32bit, and you had to jump through hoops to get 64bit installs, but it's been a few years since I looked.

    That means you're also throwing out any 32bit only ODBC drivers.

    What was the business case for this? 6GB spreadsheets?

    /endrant.


    ActiveX EXEs are out of process - so you can use those to interface with 64bit.

  5. #5
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    6,725

    Re: VB6 32bits accessing Office 64bits

    I've faced this problem too, but only minimal. In the corporate setting, all of my clients intend to stick with 32-bit Office for the foreseeable future. However, I do have a couple of client employees who have personal computers on which they wish to run my software.

    For the most part, I've pulled all the macros (i.e. VBA) out of my Office files and pulled it into my VB6 project. And, having done that, I've solved some of my problems. For one, if my VB6 project can find a copy of Office 32-bit on the machine, it can still create Office files. And I tend to use Office for several reports (with .DOTx or .XLSx templates stored in my executable's resources).

    However, there is one specific Excel file that will always have some VBA macros in it. In fact, it can be used to get quite a bit of work done without even using my VB6 program. In one case in particular (a client employee), she wanted to use this file on her personal computer (with Office 64-bit). So, I took the time to "smarten it up", and now it works.

    There were, I'd say, about a dozen API calls in it, several having to do with common dialog. The secrets were in the new LongPtr type and the PtrSafe directive in API calls. The LongPtr type was a somewhat neat trick by Microsoft. Here's what it does. If we're on 32-bit Office, it creates our old friend the Long. If we're on a 64-bit Office, it creates the new LongLong type. Therefore, the bytes of pointers are different depending on which bit Office software we're on.

    You can also just directly create LongLong types, but I had no need for that.

    I haven't done much testing to see how well VB6 will interface with Office 64-bit (if at all). I just don't know if any Automation can be accomplished, as I don't have Office 64-bit installed on my development machine. I thought one client employee actually got it going, but I'm not at all certain about that.

    And just for reference, all I use is Word and Excel (from VB6). I've only dabbled with trying to automate PowerPoint, Access, and other Office programs ... with none of that being in my primary project.

    Anyway, I think that's where we stand.

    Elroy
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  6. #6
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    6,725

    Re: VB6 32bits accessing Office 64bits

    Thierry,

    One more thought. I don't believe there's a problem with installing both Office 32-bit and Office 64-bit on the same machine. If they're upgrading, it's possible they have enough old Office 32-bit licenses for the new machines. If you just make sure their file associations are set to Office 64-bit, they may be happy with that solution.

    That way, all your Automation from VB6 to Office (including running VBA macros), could be accomplished with Office 32-bit, and then use ShellExecute to show them things with Office 64-bit.

    Just An Idea,
    Elroy

    p.s. You may still want to upgrade any VBA macros with LongPtr and PtrSafe, so they can use them when the files are called up with ShellExecute (or through their own double-click).
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2015
    Posts
    472

    Re: VB6 32bits accessing Office 64bits

    >DEXWERX, the client is using Excel in an INTENSIVE way, with very heavy excel sheets and very complex calculation (Financial)

    I am migrating an Access App to support both 32 & 64 bits, by changing API calls

    ActiveX could also be a solution for vb6 App that access Word/Excel/Outlook directly, I'll test that.
    I will create a Virtual machine with Office 64 installed inside

    Elroy, you can't install on the same computer Office 32 & Office 64.

  8. #8
    Frenzied Member
    Join Date
    Jun 2012
    Posts
    1,880

    Re: VB6 32bits accessing Office 64bits

    You can access a Vb6 Ax-dll within office 64 bits.
    However, there was a registry tweak necessary in some syswow64 node. I did that already and worked.

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2015
    Posts
    472

    Re: VB6 32bits accessing Office 64bits


  10. #10
    PowerPoster
    Join Date
    Feb 2006
    Posts
    22,839

    Re: VB6 32bits accessing Office 64bits

    Most of the "better" automation servers ("ActiveX EXEs") like MS Office programs register at installation for access from both 32- and 64-bit automation clients.

    So if your VB6 programs need to puppet-string EXcel or something it shouldn't be an issue.

    The problem comes from trying to go the other way around: Office VBA trying to make use of a VB6 DLL/OCX.

    One way around that is to compile them as ActiveX EXEs. Another is a custom installer that registers your VB6 DLL to use either the system proxy stub or a custom proxy, which a thin adapter that makes it look like an ActiveX EXE for crossing the bitness barrier.

  11. #11

  12. #12
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    6,725

    Re: VB6 32bits accessing Office 64bits

    Quote Originally Posted by The trick View Post
    There is no problem to use 64-bit office from VB6 app because the office is the out-of-process server. There is no problem to use VB6 Dlls from 64 bit office too (using DllSurrogate). There is no problem to use COM objects between 64/32 bits processes too, marshaling does all things.
    Well there you go.

    I suspect I really do need to do more testing of my Office Automation (from VB6) with a 64-bit version of Office. I've been told it works fine, but I do make extensive use of Automation in certain places.

    It's good to know that Office 64-bit could use a VB6 DLL, but personally, I don't envision a need for that. Maybe others do.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2015
    Posts
    472

    Re: VB6 32bits accessing Office 64bits

    Well, as Elroy, more testing are need, but good to know

  14. #14
    New Member
    Join Date
    Jul 2021
    Posts
    6

    Re: VB6 32bits accessing Office 64bits

    I apologize for resurrecting this post, however, I am in a situation where I am not incredibly well versed in VB6. My company is rolling out Office 64, while I am working on a migration of a VB6 application to .NET, I have no way to control what software is deployed on company computers. In anyone's testing, has anyone documented what works and what doesn't. I still must maintain this application for the foreseeable future, until my migration is complete.

  15. #15
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    4,704

    Re: VB6 32bits accessing Office 64bits

    At this moment we and most of our clients use Office 64.
    Normal Excel automation from within a VB6 application still works.

  16. #16
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    6,725

    Re: VB6 32bits accessing Office 64bits

    Yeah, since 2019, I've now got several clients using my primary VB6 application with Office 64-bit installed. My application does substantial automation of Office (mostly Word and Excel) programs, and there's no problem at all.

    The only problem I've run into is where there's some VBA code in some template that Office is directed to use, but that's really a separate issue. For VBA code that you want to be compatible with both Office 32-bit and Office 64-bit, you must learn about the LongPtr and PtrSafe stuff when API calls are made. If there are no API calls, even that works just fine in either Office 32-bit or Office 64-bit.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  17. #17
    New Member
    Join Date
    Jul 2021
    Posts
    6

    Re: VB6 32bits accessing Office 64bits

    Okay, that's good to hear, I did some initial testing and I didn't have any issues that I could find. However, as a large team of one, I just wanted to make sure that there were not any issues that I wasn't aware of. I have been lurking on the forum conducting research and testing for a while. Visio x64 is my next challenge, that is the only thing that I am not able to get working/automated.
    Last edited by LameNRG; Sep 16th, 2021 at 11:01 AM.

  18. #18
    Hyperactive Member Episcopal's Avatar
    Join Date
    Mar 2019
    Location
    Brazil
    Posts
    296

    Re: VB6 32bits accessing Office 64bits

    Taking advantage of the Thread ... what is the difference between 32bit and 64bit access? What is the advantage for each other?

  19. #19
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    6,725

    Re: VB6 32bits accessing Office 64bits

    Quote Originally Posted by Episcopal View Post
    Taking advantage of the Thread ... what is the difference between 32bit and 64bit access? What is the advantage for each other?
    Personally, I'm not sure I understand the question. What's the difference between installing MS-Office-32-bit versus MS-Office-64-bit, given that the Windows OS is 64-bit? Hmmm, I guess you'd have to ask Microsoft that one.

    If you're talking about VB6 automating MS-Office-32-bit versus MS-Office-64-bit, there's not much difference at all. That's sort of the point of this thread.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  20. #20
    Hyperactive Member
    Join Date
    Feb 2015
    Posts
    304

    Re: VB6 32bits accessing Office 64bits

    Quote Originally Posted by Elroy View Post
    If you're talking about VB6 automating MS-Office-32-bit versus MS-Office-64-bit, there's not much difference at all. That's sort of the point of this thread.
    One issue is Outlook. You can't send emails directly from a VB6 app if the Outlook version is 64 bit.
    If you use a third-party tool such as Outlook Redemption or vbMAPI to get around issues with the Outlook Object Model then the bitness of your app has to match the bitness of Outlook - which rules out VB6.

  21. #21
    Lively Member
    Join Date
    Nov 2016
    Posts
    74

    Re: VB6 32bits accessing Office 64bits

    This is my experience: I have office 2013 64 bit and VB6 which performs some data export functions both on Word, Excel and Powerpoint documents and everything works fine as with office 32 bit. for example
    .ParagraphFormat.Alignment = WDALIGNPARAGRAPHCENTER; .TypeText ; oRange.ConvertToTable vbTab, NumColumns:=1, Format:=GridWDStyle, ApplyBorders:=True, ApplyShading:=True, ApplyFont:=False, ApplyColor:=True, ApplyHeadingRows:=True, ApplyLastRow:=True, ApplyFirstColumn:=True, ApplyLastColumn:=True, AutoFit:=True
    and so on...

  22. #22
    Hyperactive Member Episcopal's Avatar
    Join Date
    Mar 2019
    Location
    Brazil
    Posts
    296

    Re: VB6 32bits accessing Office 64bits

    Quote Originally Posted by Elroy View Post
    Personally, I'm not sure I understand the question. What's the difference between installing MS-Office-32-bit versus MS-Office-64-bit, given that the Windows OS is 64-bit? Hmmm, I guess you'd have to ask Microsoft that one.

    If you're talking about VB6 automating MS-Office-32-bit versus MS-Office-64-bit, there's not much difference at all. That's sort of the point of this thread.
    None of the answers. I mean about the data limit in gigabytes, writing and reading speed, and the like.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width