06-09-2017 04:58 PM
Hello!
So I have a 2D array of data that I pulled from a separate file and I am trying to arrange and put into a new file but I am running into an error using ActiveX when it comes to specifying the cells I want each bit of data to go into. I do not understand how the Worksheet Range property works when given an array of cell numbers with the 2D array of data I am using. I noticed that if I only give it one cell name, for example A2, it will put my very first piece of data into that cell, but I can't figure out how to get the rest of the data in. I inserted pictures of an example array of data I am trying to use as well as the snippet of the code that I have to accomplish this task. Essentially, I am just looking to take this data, swap some of the columns and then write that data into an excel file that already has headers and formatting done. I hope this is making sense, but any help is appreciated! Thanks!
Solved! Go to Solution.
06-09-2017 08:48 PM
06-12-2017 10:04 AM
Thanks! I'll try that!
06-12-2017 10:55 AM
I tried this and the data ended up repeating in each row...
So I tried just deleting one column from the array of data and using that column of data I tried A2:A13, but it just placed the very first element of the array in each row. Any idea what's going on?
06-12-2017 11:55 AM
06-13-2017 10:00 AM
Here is my VI I have been using. Right now I only have it extracting one column from the excel file and writing it to a new excel file, but the overall goal is to have it extract all the columns and place them in new columns in the new excel file as soon as I figure out why its not writing properly. I also included the excel file with my test data and the template I am using for the new excel file. Thanks for all the help!
06-13-2017 11:00 AM
To begin with, it's a bad idea to open and close Excel for each file, it should be open once at the beginning and closed in the end. I have no idea how you ended up with repeated first line, maybe an effect of closing and reopening the application rapidly. I simplified your vi and it seems to work fine.
Ben64
06-13-2017 11:09 AM
Awesome! I'm new to ActiveX so I'm still learning the proper way to use it so thank you for all the help! Would you be able to back save the VI to LabView 2013 though? I can't open it because I don't have the latest version.
06-13-2017 11:15 AM
06-13-2017 11:31 AM
Thanks so much for all the help! I really appreciate it!