10-20-2011 10:28 AM
I am having trouble trying to insert an excel worksheet from one workbook into another workbook. None of the excel functions seem to work for me and I am having a problem trying to find a good example. Basically what my program does is it will collect temperature data from an appliance over an hours time and then spit this data to an excel template which already has an implemented graph and a formula chart. The graph that I am using is an older excel graph which cannot be changed. After the data is added to the excel spreadsheet, the excel graph will update with the new data and I run a few macros to process the data and save to the formula chart. The issue though is, I don't know upfront how many tests I need to run so I want to add a spreadsheet template (which has the embedded graph and chart) to the end of the workbook and follow the same data process from above. This will happen for as many tests as I need to run. Can anyone help me with this issue.
10-20-2011 10:57 AM
I'm working on the attached vi, which in its current state will copy a sheet from an excel file to another bringing along the formatting, etc. It copies fine, however I'm having trouble closing out Excel after the vi executes (which isn't a huge problem but I would like to solve it).
Can anyone shed some light as to why that is happeining?
10-20-2011 11:01 AM - edited 10-20-2011 11:02 AM
10-20-2011 11:04 AM
Isn't that what this is? Or am I using it in a wrong way?
10-20-2011 11:07 AM - edited 10-20-2011 11:08 AM
10-20-2011 11:09 AM - edited 10-20-2011 11:10 AM
I've opened 2 excel references, the original where I'd like the second excel sheet to merge into, and the one with the sheet to be merged. Attached should be the whole vi so you can get a better idea.
Edit: I do not get an error reported
10-20-2011 11:15 AM - edited 10-20-2011 11:16 AM
Would it work to open Excel once, and choose different workbooks within that (for the different files)? This is my first project with activeX so I have a bit of a learning curve, and I do appreciate the help.
10-20-2011 11:21 AM
10-20-2011 01:13 PM
Thanks for the help ben64. I've revised it to use only one Excel._Application reference, and added the _Workbook.Close method, but Excel stays open as one of the processes (the application itself is hidden). Still works like a charm, just doesn't want to close out of Excel.
10-20-2011 01:15 PM