10-21-2005 10:20 AM
10-25-2005 02:08 PM
Gonna bring this thread back from the recently deceased...hey, it's Halloween!
Having trouble writing to an excel file while trying to work your examples into my code. In my code, I have my spreadsheet writing to a refnum. (Previously, I was writing to a txt file. Now I'm trying to do the same thing, just converting the txt file into a spreadsheet so I can use certain cells for certain chunks of data.) When I wire my refnum into the reference input of the Invoke Node tool, it tells me I'm wiring a "byte stream file reference" into a "automation reference of class". I've tried all sorts of conversions, but it seems like no matter what I do, my input type does not match the expected input. File type, pathnum, reference, refnum, automation reference.....ARRGGHHH! Doesn't matter what I use, it's always wrong!!
I've included the chunk of code where I'm trying to write a value to cell C3 in my spreadsheet. How do I get my input refnum to match what the Invoke Node tool is expecting??
10-25-2005 03:02 PM
Hi,
Can you show me how you make this refnum. Open Excel, open workbook... and so on.
Besides that the property node Value is now Value2 on my PC
10-25-2005 03:08 PM
Here's where the file (and refnum) is originally created. It was originally a txt file and I'm in the process of changing it to an xls spreadsheet, so it looks a little goofy for now. I want to get it working as a spreadsheet before I start cleaning things up.
Ahhhh, who am I kidding? When do you ever really get time to go back and clean up a program?
10-25-2005 03:15 PM
I was afraid of that, you have to do much then just open a file. See the Excel6.1.zip in reply 10. One of the VI opens a spreadsheet file with ActiveX
Let me know if this helps
10-25-2005 03:33 PM
Still doesn't work. Some quick info - my program is a big stacked sequence, that bounces from case to case depending on test conditions. In one of my initial cases, I create the spreadsheet. Rather than continuously opening and closing that spreadsheet in every case, I have created a shift register of the refnum of the file. I'm trying to use that refnum shift register in another part of the stacked sequence. It used to work fine with a text file.
But now when I wire that refnum shift register to the Invoke Node tool, it tells me I'm wiring a "byte stream reference" to a "automation reference of class" input. I'd like to use the refnum shift register rather than keep reopening the same spreadhseet in each case.
10-25-2005 04:22 PM
10-26-2005 08:08 AM
10-26-2005 08:50 AM
@Spaceman spif wrote:
That's what I've been working on - something that takes a refnum of a spreadsheet file and converts it into Active X refnum that the Invoke Node tool will accept. Haven't succeeded yet, so if anyone has any ideas, please post!!! Until then, I'll keep chugging away at it!
You cannot convert a spreadsheet file refnum to an Active X refnum it will not work. Are you having trouble using/ getting an Active X refnum for an excel spreadsheet.
10-26-2005 08:54 AM
Should I route the File Path into the shift register instead of the refnum? Would that work?
Yes, I can't seem to create an ActiveX refnum of the spreadsheet.