+ Reply to Thread
Results 1 to 18 of 18

Need help getting VBA working on new computer

  1. #1
    Registered User
    Join Date
    04-08-2014
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    9

    Question Need help getting VBA working on new computer

    Hi guys. I am a technician who is trying to comply with the IT mandatory Win7 computer upgrade.

    I have some test systems that were written in VBA that are being problematic. I was able to figure out how to get the bad references fixed, but the program still is not working correctly. I can now start the program, but the first thing it does is have the user select the COM port. COM1 is available according to the Windows Hardware Manager. However, the buttons that allow the operator to select the COM ports are all grayed out (Excel does not recognize that any ports are good to use.) Does anyone have ideas how to get this running? One of the things I tried doing is copying the old reference files from the other system and relinking them, but that did not work at all. Does anyone know how to get an old reference working? (E.g. the original system uses "Microsoft Excel 9.0 Object Library" and the new system uses "Microsoft Excel 14.0 Object Library")

    I am competent in C++ coding, but VBA is completely new to me. Any advice you guys can offer would be much appreciated.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Need help getting VBA working on new computer

    Wow. That's some old code there.

    You won't be able to reference the Excel 9.0 object library unless you install (and work in) Excel 2000.

    Looks like you're going to have to unpick the code... How about posting up the routine which is polling the COM port, see if we can fix that?

    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    04-08-2014
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Need help getting VBA working on new computer

    Thanks for the reply. I think this is the serial code. At least it is the code behind the window where the user has to select a COM port. If it is not, let me know and I will see what I can find/sanitize.
    Please Login or Register  to view this content.
    Edit: Fixed code formatting
    Last edited by seeigecannon; 04-08-2014 at 09:50 PM.

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Need help getting VBA working on new computer

    First things first - it's much easier to read if you wrap CODE tags around code that you post - like this:
    Please Login or Register  to view this content.
    It looks like the stuff you've posted is just dealing with which COM ports are selected on a userform, and ensuring the option buttons display the selected state.

    Nothing in that code is referencing an older object library, that I can see...

    Can you attach a workbook? Remove any confidential or sensitive data first, of course, but leave code and structures in place as far as you can.

  5. #5
    Registered User
    Join Date
    04-08-2014
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Need help getting VBA working on new computer

    Unfortunately, I wouldn't be able to trust myself to be able to remove confidential information from that much code. I'm still not sure how deep it goes due to the fact that I didn't even know one could program in Excel until just last week.

    Is there anything I can search for that would indicate what is getting the COM port info?

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Need help getting VBA working on new computer

    I'd start by tracing this:
    Please Login or Register  to view this content.
    PortArray looks like a string with ten 0 or 1 values to indicate the status of COM ports 1-10. I would imagine that this variable is written by a routine which polls the COM ports. Try and track down which bit of code is writing to this variable.

  7. #7
    Registered User
    Join Date
    04-08-2014
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Need help getting VBA working on new computer

    I was able to find this:
    Please Login or Register  to view this content.
    Edit: This does look much better.

  8. #8
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Need help getting VBA working on new computer

    Okay, looks like sheet "Private" has some functions in its module: GetPorts, OpenPort, GetData, ClosePort - and it looks like these are the functions which actually interact with the COM ports.

    I'm not following the .channel reference, though, and the functions are associated with that object... it's not a standard object. Dig around in that worksheet, see what channel is, and what the functions associated with it are doing.

  9. #9
    Registered User
    Join Date
    04-08-2014
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Need help getting VBA working on new computer

    The .channel thing is being thrown around quite a bit. I found some more stuff pertaining to the serial port:

    Please Login or Register  to view this content.
    I also pulled the references here:
    Visual Basic For Applications
    Microsoft Excel 9.0 (now 14.0)
    OLE Automation
    Microsoft Office 11.0 Object Library (now 14.0)
    Microsoft Forms 2.0 Object Library
    X328CommX ActiveX Control module (pulled from previous system)
    CCRP High Performance Timer Objects [VB6] (pulled from previous system)
    Microsoft Scripting Runtime


    "Microsoft Excel 9.0 (now 14.0)" This means that the original system was running Excel 9, but the new system is running 14.

    Does this help any? (And thanks for spending the time to help a noob out.)

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

    Re: Need help getting VBA working on new computer

    I think that Channel is a control (X328CommX ActiveX Control) embedded on the Private worksheet. I'm not sure what you mean when you say "pulled from previous system"? If the reference is not available on your new machine, that would certainly explain why the code doesn't work - though I would have expected you to get an error message about the control not being available on that machine.
    Remember what the dormouse said
    Feed your head

  11. #11
    Registered User
    Join Date
    04-08-2014
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Need help getting VBA working on new computer

    When I say "Pulled from the previous system" that means that I found the DLLs (and other files) that were being called on the old system and copied them to the new system in the same directories.

  12. #12
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Need help getting VBA working on new computer

    seeigecannon, I'm about at the limit of my help, without seeing some more specific code to step through... I suspect others feel much the same. I hope you manage to get this fixed!

  13. #13
    Registered User
    Join Date
    04-08-2014
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Need help getting VBA working on new computer

    Thanks for trying. I am currently trying to go through tutorials (the ribbon that MS Office uses now invalidated most of the decent looking tutorials I have found so far). I am also looking in rewriting all of the COM port stuff from scratch using a different driver.

  14. #14
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Need help getting VBA working on new computer

    I wish I could offer more help, as your project has piqued my interest! Ping me if I can help offline.

    Also, don't be too put off by the ribbon - it doesn't actually restrict any functionality

  15. #15
    Registered User
    Join Date
    04-08-2014
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Need help getting VBA working on new computer

    Its not so much the functionality that is bothering me, its the fact that a tutorial will say "Go to Tools>Macro>Editor" and I am left scratching my head wondering where Tools went.

    I really wish there was an option to go back to the classic menus as that's what I grew up using.

  16. #16
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Need help getting VBA working on new computer

    I was always a power keyboard shortcut user, and thankfully the old kb shortcuts all still work :D

    Although we haven't fixed your problem in this thread, do keep posting new threads for help, even if it's just stuff like "Where on the ****** ribbon do I find xxx?!" Interactive support beats tutorials, every time

  17. #17
    Registered User
    Join Date
    04-08-2014
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Need help getting VBA working on new computer

    HOLY CRAP! I managed to get it working.

    The X328CommX turned out to be a driver made in house. I was using Notepad++ to view its binary contents. While doing so I found some interesting text strings, so I searched the engineering servers for those strings in the hopes of finding the source. I was unable to find the source, but I did manage to find a installer for the driver (a bat file). All the installer really did was copy a couple of files and run regsvr32 on the files. The program works now. Thank you guys for taking time to try to help me out. Not gonna' lie, but I hope to never have to deal with VBA ever again. C++/C/VHDL FTW.

  18. #18
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Need help getting VBA working on new computer

    Good work, sir Really glad you got it sorted - one of the more interesting challenges on here in a while

    Don't disregard VBA - it's a nice little world we live in

+ 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. Replies: 10
    Last Post: 01-07-2013, 02:38 PM
  2. [SOLVED] Formular not working on my computer
    By Zundah in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-15-2012, 11:15 AM
  3. Date Filter working In One Computer but Not Another
    By coolchick in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-09-2010, 11:26 PM
  4. Sendmail not working when computer is locked
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-31-2005, 06:05 AM
  5. [SOLVED] DB not working on other computer
    By lyndac in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-16-2005, 04:05 PM

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