+ Reply to Thread
Results 1 to 7 of 7

Determine the value of a shape (radio button) programmatically

  1. #1
    Registered User
    Join Date
    06-23-2023
    Location
    Toronto Ontario Canada
    MS-Off Ver
    O365
    Posts
    4

    Lightbulb Determine the value of a shape (radio button) programmatically

    Hey folks. I've inherited a process that has hundreds of identical PDF forms filled out and I now need to scrape the data out of it. I'm able to export the PDF to Excel and now most of the data is a set of radio buttons (as shapes) in a row with a few dropdowns and some text boxes. Does anyone know how to get the value of the individual radio buttons in VBA? I've hunted high and low and see now 'value' property. Do I need to cast the shape to something else? Is there a 'hidden' property? Can I tell somehow from the shape's formatting whether it's been pressed or not? (Note that the form is filled in as a PDF so there's no way to run event code. I have to read it after the fact.) Any help would be hugely appreciated.

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,410

    Re: Determine the value of a shape (radio button) programmatically

    see big yellow banner - how to upload files - far easier then to give an answer/solution.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Registered User
    Join Date
    06-23-2023
    Location
    Toronto Ontario Canada
    MS-Off Ver
    O365
    Posts
    4

    Re: Determine the value of a shape (radio button) programmatically

    I don't really have much code to share. Here's a snippet of what I started to develop, but I need some way to determine the value of the shape
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by enyman61; 09-13-2024 at 10:19 AM. Reason: Adding excel file from PDF as sample

  4. #4
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,966

    Re: Determine the value of a shape (radio button) programmatically

    I don't think there is anyway to get a property from these; they're just pictures rather than controls. That said all the images of a selected radio buttons are (at least on this occasion) called "image1.png". Therefore, you can use the name to identify them.

    e.g.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-23-2023
    Location
    Toronto Ontario Canada
    MS-Off Ver
    O365
    Posts
    4

    Re: Determine the value of a shape (radio button) programmatically

    Yes, I've reached the same conclusion. Not sure it will always be image1.png but I'll see if that's the case. Unfortunate that the PDF export uses pictures. But I'll see what I can do

    Thanks anyway.

    I'll close the thread

  6. #6
    Registered User
    Join Date
    06-23-2023
    Location
    Toronto Ontario Canada
    MS-Off Ver
    O365
    Posts
    4

    Re: Determine the value of a shape (radio button) programmatically

    Hmm. I'm new at this (first post). I don't see how to close the thread. Is that something we should do? Or is it just left?

  7. #7
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,966

    Re: Determine the value of a shape (radio button) programmatically

    You can mark it SOLVED under Thread Tools, but you may want to leave it open in case someone else has an idea.

+ 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] Need help with radio button enable using 2 different type of radio button
    By excelvbanew in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-29-2023, 08:17 AM
  2. [SOLVED] How to have a User Form Radio Button that is controlled by a radio button on Worksheet
    By cameronadill in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-10-2022, 01:22 PM
  3. [SOLVED] How to connect User Form Radio Button to Radio Buttons in Workbook
    By cameronadill in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2022, 07:43 AM
  4. [SOLVED] Use a button to control a macro that inserts an image into a shape or resets the shape
    By nwb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-13-2013, 04:41 PM
  5. Adding text to a freeform shape programmatically Excel VBA
    By waqas716 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-01-2011, 07:57 AM
  6. Pressing one radio button to select another radio button
    By raehippychick in forum Excel General
    Replies: 1
    Last Post: 09-13-2007, 11:30 PM
  7. Programmatically determine Chart's data source
    By drussell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2006, 01:30 AM

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