LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Having problems creating a folder and excel file Programmatically

Solved!
Go to solution

@santhoshbalaji wrote:

Sorry Altenbach,

 

I can't handle stupidity so i'm out of this conversation

 

Good luck keep arguing


sorry santhoshbalaji,

 

I think Altenbach is making a good point

 

You should replace the word "stupidity" with "yourself "

 

Please respect others

0 Kudos
Message 11 of 19
(2,560 Views)

@coloredsound wrote:

@santhoshbalaji wrote:

Sorry Altenbach,

 

I can't handle stupidity so i'm out of this conversation

 

Good luck keep arguing


sorry santhoshbalaji,

 

I think Altenbach is making a good point

 

You should replace the word "stupidity" with "yourself "

 

Please respect others


Altenbach is making a VERY good point.  The confusion between a true Excel formatted file and a simple delimited spreadsheet file is a common issue around here.  It's important to know the difference.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 12 of 19
(2,537 Views)

In all the excitement, I'm not sure anyone addressed the question that SoIPS raised, namely how to deal with nested folders and files.

 

Here is a little demo that illustrates how file and folder nesting work.  It starts with a root path, C:\, then appends "1.txt", "2.txt", etc., saving the growing path in Path Array.  

 

The important point is that the final "filename", say "4.txt", is treated as a file name, while the preceding part of the path, say "C:\1.txt\2.txt\3.txt" is (automatically) treated as the Folder name.  Whatever you wire into Build Path as "Folder" (whether it is a string or a folder) will be considered a folder path, and whatever (string) you wire into File becomes the Filename, with LabVIEW automatically adding the backslash separator.

 

Think about how this works, then rewrite your own code to "do what you want it to do, not what you told it to do".

 

Folders and Files.png

 

Bob Schor

 

Message 13 of 19
(2,523 Views)
Solution
Accepted by SolPS

Thanks everyone for all your responses. Matter of fact, I fgured out what I was doing wrong yesterday.  Wiring the ouput of the build path VI will create a file as opposed to wiring to the output of the create folder VI.  This VI that I attached is actually a subvi of my report generation VI which creates an excel file test report. The excel file is always created before this subvi is called.  Thanks again everyone for your input.

Message 14 of 19
(2,508 Views)

I have the same issue you had 2 years ago . Could please attach what you fixed ?

I am generating a report in labview that will be in excel and i want all my test report to be saved in the same folder .

0 Kudos
Message 15 of 19
(1,888 Views)

As one of the contributors to the previous discussion, I need to ask that you attach your VI (don't even think about attaching a picture of your Block Diagram) and explain what you are trying to do.  For example, when you say "Excel", do you mean what LabVIEW calls a Delimited Spreadsheet File, or do you mean a file written by Microsoft Excel, having the extension .xls or .xlsx?  [Don't answer the question, rather attach your VI so we can see for ourselves what you are trying to do].

 

Bob Schor

0 Kudos
Message 16 of 19
(1,885 Views)

Thanks Bob_Schor for the quick reply .

I am trying to create a test report and i want all those report to be saved in a specific folder  automatically every time the programs runs.

0 Kudos
Message 17 of 19
(1,881 Views)

Two suggestions:

  • Connect the .xlsx extension to the Concatenate Strings function.
  • In the Forum's Search bar, type the word "Revised " (leave out the quotes, but put in the trailing space) and see if anything looks interesting.  You should see a reasonably-complete-and-documented Example posted about 4(?) years earlier.

Bob Schor

Message 18 of 19
(1,872 Views)

Thanks Bob 

0 Kudos
Message 19 of 19
(1,867 Views)