LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Invoke SaveAs Excel

Solved!
Go to solution

I'm working on streamlining a process for saving files once the program has been completed and I can't seem to figure out how to automatically fix a SaveAs issue where the file name already exists. If the file name already exists, I just want to add an "_1" at the end and try saving again, increasing the number by 1 each time it fails until it finally has a name that doesn't exist. I tried to grab the error out from the Invoke node however, the saveas dialog box still appears and the loop I made to add the "_#" at the end doesn't start. Any ideas?

0 Kudos
Message 1 of 5
(447 Views)

Hi jwohler,

 


@jwohler wrote:

Any ideas?


Idea: when you have problems with YOUR code then you should attach YOUR code so we can inspect it and (maybe) provide improvements/suggestions!

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 2 of 5
(442 Views)

Well my main issue is just trying to figure out how the Invoke Node works and if there's a way around the Excel SaveAs dialog box. I can't seem to find any documentation on how the various classes/methods work with the Invoke Node.

0 Kudos
Message 3 of 5
(435 Views)

Hi jwohler,

 


@jwohler wrote:

Well my main issue is just trying to figure out how the Invoke Node works and if there's a way around the Excel SaveAs dialog box.


The Invoke node calls an Excel method - and you can do NOTHING while Excel is busy with executing that method!

When you need to check the filepath than you should do that BEFORE you call Excel to save the data using your filepath…

 


@jwohler wrote:

I can't seem to find any documentation on how the various classes/methods work with the Invoke Node.


All those Excel methods/properties are explained at MSDN - you "just" need to read the manuals…

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 4 of 5
(408 Views)
Solution
Accepted by topic author jwohler

@jwohler wrote:

I can't seem to figure out how to automatically fix a SaveAs issue where the file name already exists. If the file name already exists, I just want to add an "_1" at the end and try saving again, increasing the number by 1 each time it fails until it finally has a name that doesn't exist. 


That's exactly what Create File with Incrementing Suffix VI does...

 

But as everyone else said you will have to do this before invoking your method.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 5
(387 Views)