Hello people, For my internship I am attempting to fully automate monomer composition analysis on Bruker TOPSPIN 2.0 using visual basic and macro's. It's almost fully functional but I've come across the following problem: I want to use the integral data of a spectrum in calculations (i.e. export them to an excel template) but so far I've found no way of exporting integral data without using the mouse (I can make visual basic simulate mouse clicks, but it's not a method I like using since it makes the program very prone to failure or outdating). The "exportfile" command exports data based on what tab of the dataset you are currently viewing, but I haven't found any command to open the Integrals tab. Does anyone know how I could solve this? Thank you in advance. asked Nov 22 '10 at 02:38 Nathanael91 |
It pains me to see you have to resort to mouse clicks. If that suits you, fine...otherwise read on. The following code is maybe more what you need (you will end up with a csv file called "integrals.csv" in your proc directory:
answered Nov 25 '10 at 07:34 |
There is no real problem getting the integrals into a file. The following AU program will generate a file called "integrals.txt" in the processed directory:
No mouse needed! Hope this helps, John answered Nov 25 '10 at 02:48 |
Thanks everyone for your help so far:) Sadly as far as I know I can't import ascii files into excel, but I've found a workaround I basicly used a simulate mouse click command and made it maximize the window and open the data sheet before the click, preventing any problems from occuring. Most programmers will shun this method, but it gets the job done. answered Nov 25 '10 at 04:41 Nathanael91 |
It looks like that code does exactly what I want it to do (so exactly what my program does now (up to the file name and path:P), but without additional input from visual basic) I'll try it out this afternoon, thanks a lot. PS: Is there also a way to export the spectrum to a specified path? right now it opens the export window and visual basic fills in the path name, but again, that's not optimal, I'd rather not have visual basic do anything with the nmr software after it's transfered the input variables answered Nov 25 '10 at 23:24 Nathanael91 in what format would you like to export the spectrum? - Clemens Anklin (Nov 30 '10 at 09:12) |
I think Mo has a good point. NMRPipe is probably easier to automate, since it was written for that purpose anyway. - Evgeny Fadeev (Nov 23 '10 at 09:52)