Reply To: Visual Basic coding, Cells to Form Fields export

  • Liz Larsen

    Member
    January 22, 2023 at 2:43 pm
    Points: 5,232
    Rank: UC2 Brainery Purple Belt UC2 Brainery Purple Belt Rank

    Ok, at some point, I saved the wrong version of my code with is why problem #1 happened. It’s fixed now.

    To answer your questions:

    1. I think the duplicated field names you’re referring to were the ones without numbers on the end (BOXTAG and AirType). That’s because I saved the wrong version of my code. The attached code is now correct. I have an if statement in there to properly add the column number to the form field string, and that somehow never made it to the code I saved previously. *womp womp* 😞
    2. I ran your code and it is saving as an FDF file, it’s just adding “.xlxs” or “.xlm” to the end of the file name because you’re using the dialog box to select a save location. But, at least on my end, the file is technically an FDF file. To fix this, I added a simple Replace function in your code to remove the excel file extension. See attached screenshot.

    Also note that you removed the Offset from my code, with is essential because that’s what is looping through the columns to get their values.