+ Reply to Thread
Results 1 to 3 of 3

Get game controller (joystick) axis position in Excel VBA possible?

  1. #1
    Registered User
    Join Date
    01-04-2004
    Location
    Netherlands
    Posts
    59

    Get game controller (joystick) axis position in Excel VBA possible?

    Hi all,

    This is a bit far fetched. My 10 minutes of searching didn't really come up with anything. That means its either unlikely to be possible, or such a silly idea that nobody has done it yet. :-) (or I can't use a search engine)

    Is there a way for Excel VBA to read the analog axis of a game controller or joystick that's just a normal HID device in Windows?
    I'm looking to setup a simple logging program that records the axis position every so often and puts it in an array or on the sheet for later analysis.

    In case anyone has done this or seen it done, I'm all ears!

    Regards,
    Niels

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Get game controller (joystick) axis position in Excel VBA possible?

    If you are using a Windows OS, you can use DirectX for this.

    First, set references to "DirectX 7 for Visual Basic Type Library", and then put this code on "ThisWorkbook" module (not normal module) :

    Please Login or Register  to view this content.
    I just use the MsgBox to show how the code is working, if you want to put the result to an array, you (or other forum member here) should modify the code.


    Regards
    Attached Files Attached Files
    Last edited by karedog; 05-27-2020 at 07:01 AM.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Registered User
    Join Date
    01-04-2004
    Location
    Netherlands
    Posts
    59

    Re: Get game controller (joystick) axis position in Excel VBA possible?

    Thanks.

    Should this also work on 64 bit Windows 10? In the references list, it says : "MISSING: DirectX 7 for Visual Basic Type Library"

    I have found this file somewhere and put it in my System32 folder. After a reboot it is still reported as missing.
    Shouldn't DirectX be backwards compatible? I downloaded DX7 and it won't install as it is not supported on my OS..

    Edit: I've also ran DXWebSetup which puts a bunch of old Dx DLL files in there for compatibility with older games.

    Edit2: It seems to work putting it in SysWOW64 and adding it to the registry. I'll be having a good play with the code!

    Thanks,
    Niels
    Last edited by niels007; 05-28-2020 at 07:56 AM.

+ 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: 2
    Last Post: 04-15-2015, 01:10 AM
  2. Move Label Axis to position under both columns
    By krunk in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-03-2013, 07:34 PM
  3. getting the same position axis with 2 horizontal axes
    By niklas24 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 07-01-2013, 11:19 PM
  4. Shifting the position of x-axis labels
    By den1s in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2006, 08:10 AM
  5. how can i change position of x and y axis in chart?
    By zare-jamal in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 10-27-2005, 09:05 AM
  6. Formulas for race game (position calculation after each round)
    By 0-0 Wai Wai ^-^ in forum Excel General
    Replies: 0
    Last Post: 07-26-2005, 06:05 AM
  7. [SOLVED] Joystick
    By Himszy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2005, 03: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