06-23-2010 03:38 PM
You need to tell Read File how many bytes to read. I would typically wire the refnum of Open File into a Refnum to Path function and wire this path to File/Directory Info. Wire the Size output to the count input of Read File.
06-23-2010 03:45 PM
Wouldn't it simply be easier to just copy the file and work with the copy as your new spreadsheet?
06-23-2010 03:50 PM
@Darin.K wrote:
You need to tell Read File how many bytes to read. I would typically wire the refnum of Open File into a Refnum to Path function and wire this path to File/Directory Info. Wire the Size output to the count input of Read File.
Thanks, that worked (you're amazing, btw). I got a blank template file out with the macro in it.
I'm trying to be able to store the .xls template in a string inside the VI to create it whenever its needed, so the end user doesn't have to deal with copying a specific blank file in each time.
@smercurio_fc wrote:
Wouldn't it simply be easier to just copy the file and work with the copy as your new spreadsheet?
06-23-2010 05:49 PM
@bobholmgren wrote:
@Darin.K wrote:
You need to tell Read File how many bytes to read. I would typically wire the refnum of Open File into a Refnum to Path function and wire this path to File/Directory Info. Wire the Size output to the count input of Read File.
Thanks, that worked (you're amazing, btw). I got a blank template file out with the macro in it.
I'm trying to be able to store the .xls template in a string inside the VI to create it whenever its needed, so the end user doesn't have to deal with copying a specific blank file in each time.
@smercurio_fc wrote:
Wouldn't it simply be easier to just copy the file and work with the copy as your new spreadsheet?
I wasn't implying for the user to copy the file. I was implying for you to copy the file. You'd have the template file along with your app and you copy the file and use it as the new file.
06-23-2010 05:54 PM
@smercurio_fc wrote:
@bobholmgren wrote:
@Darin.K wrote:
You need to tell Read File how many bytes to read. I would typically wire the refnum of Open File into a Refnum to Path function and wire this path to File/Directory Info. Wire the Size output to the count input of Read File.
Thanks, that worked (you're amazing, btw). I got a blank template file out with the macro in it.
I'm trying to be able to store the .xls template in a string inside the VI to create it whenever its needed, so the end user doesn't have to deal with copying a specific blank file in each time.
@smercurio_fc wrote:
Wouldn't it simply be easier to just copy the file and work with the copy as your new spreadsheet?
I wasn't implying for the user to copy the file. I was implying for you to copy the file. You'd have the template file along with your app and you copy the file and use it as the new file.
Ah, I get what you're saying. Yeah, that would have worked (and taken the same amount of disk space too), but I've already written all this new code. Hmm, I might switch to what you recommended though, cause then it'd be easier to change the template code (just move the new file in with the same name) as opposed to having to paste in text of the binary if I modify the template
06-23-2010 06:47 PM
Either method will work in your case. I rarely use Excel, but when I do I write my own xlsx or xlsm files so I do not have to have Excel installed on all of my machines. With this method, once you have the skeleton, it is easy to add macros, charts, sheets, etc. without using ActiveX or Excel itself. I only need the starting point and all changes can be made programmatically. Keeping a string constant is quick and easy for me. If you are using ActiveX I can see that you probably want to modify your macro several times.
When you upgrade to LV9 I can help free you from ActiveX, until then, keep plugging away.