PotterHarry Posted December 30, 2018 Report Share Posted December 30, 2018 Hi again! I have been experimenting with VBA in Excel. I have succeeded in creating two columns of values ( representing mouse coordinates) which I have stored in an array variable. What is the best method of getting that variable over to ME Pro? I assume registry write is an option. Will the format of the array be compatible? Excel is very good at doing what I'm trying to achieve (relative position of pixels) but I always fear that solutions that would be obvious to an experienced programmer would be lost on me! Thanks... Quote Link to comment Share on other sites More sharing options...
Cory Posted December 30, 2018 Report Share Posted December 30, 2018 If you want to permanently store it someplace, I recommend a CSV file. Then you can do the ASCII File Process to load. Or maybe save all the X values in one file and the Y values in another with a delimiter (EG a comma) and use the split command on macro load. Then you could have two arrays in MEP where the index matches between X and Y values. That would be fast and simple to load. If you would like a sample, post your Excel file so I have something to show you with. Quote Link to comment Share on other sites More sharing options...
PotterHarry Posted December 30, 2018 Author Report Share Posted December 30, 2018 Thank you very much Cory. Here is the file... two columns ready.xlsm Quote Link to comment Share on other sites More sharing options...
PotterHarry Posted January 1, 2019 Author Report Share Posted January 1, 2019 . Quote Link to comment Share on other sites More sharing options...
PotterHarry Posted January 1, 2019 Author Report Share Posted January 1, 2019 I have had a go at this using my two columns of data saved as a .csv. I am seemingly getting the correct pairs of values (giving me hope!) apart from at the very first iteration I'm getting this odd symbol ... 0 I placed a text box between Ascii file begin process and ascii file end process %T[1]% %T[2]% %T[3]% %T[4]% %T[5]% %T[6]% %T[7]% %T[8]% On running it I'm seeing 0 1 -1 0 0 1 -1 1 They are all the correct values for the start of the series. I guess I just need to trim that first value back to a 0 assuming the garbled stuff will be the same with different .csv files? Quote Link to comment Share on other sites More sharing options...
Samrae Posted January 2, 2019 Report Share Posted January 2, 2019 The odd characters in the first record are there to identify the type of encoding used in the file. To avoid this try to save the .csv file in a different format, perhaps UTF-8. The format to use may or may not be shown as UTF-8. In my (older) version of Excel there is an option to save a file with the format "csv (MS-DOS)(*.csv)". If you are unable to change the format when creating the .csv file you could use the Variable Modify String commands to removed those characters. Quote Link to comment Share on other sites More sharing options...
PotterHarry Posted January 3, 2019 Author Report Share Posted January 3, 2019 Thanks Samrae (and Cory for the guidance) I have the whole thing working now. The mistake I made was saving the .csv as UTF-8. The other option got rid of the squiggle... Thank you !!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.