LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Having problems creating a folder and excel file Programmatically

Solved!
Go to solution

Hi everybody,

 

I'm having difficulty creating an excel file inside a subfolder. First I create the top folder, then the sub folder and then the file.  My VI generally works however at the point where the file is supposed to be created, it creates another folder instead. I've perused the forums here for similar issues and the generelly recommeded remedy was to add another backslash to the file path.  When I try to add the back slash to the path constant, it doesn't seem to accept it.

See attachment for sample code.

 

Thanks

Download All
0 Kudos
Message 1 of 19
(4,891 Views)
In your code start path ("D30 Wobble head") is empty. So you get wrong path. Also I didn't see creation, only copy. If I set correct start name, your VI works correctly.
0 Kudos
Message 2 of 19
(4,867 Views)

@SolPS wrote:

Hi everybody,

 

I'm having difficulty creating an excel file inside a subfolder. First I create the top folder, then the sub folder and then the file.  My VI generally works however at the point where the file is supposed to be created, it creates another folder instead. I've perused the forums here for similar issues and the generelly recommeded remedy was to add another backslash to the file path.  When I try to add the back slash to the path constant, it doesn't seem to accept it.

See attachment for sample code.

 

Thanks


Hi,

     You haven't created any xl file in your vi and how can you expect the vi to create a xl file???

 

See to the vi snippet where you can create a empty xl file , and continue your process, and then pass the data to be written to the xl file by calling it

 

xl.png

 

Kudos welcome 🙂

 

Certified-LabVIEW-Associate-Dev_rgb (1).jpg

Certified LabVIEW Developer
Best LabVIEW Programmer @NIDAYS 2015
Message 3 of 19
(4,843 Views)

What is the difference between case 0 and 1? They seem to differ mostly by a single diagram constant (and a missing wire),  so why do you have all that duplicate code? Share the common code and only place the differences inside a case (or use a select).

You are trying to create a folder with the name ...\something.xls\result_allnetwork".

You never create an xls file anywhere.

 

Place a probe on all the intermediary paths and see if they are actually what you expect.

 

(And naming a delimited spreasheet file with a *.xls extension as suggested by others also does not create an excel file.)

 

Also:

There is a primitive to see if a string is empty.

Your boolean terminals should be on the toplevel diagram (outside the case structure). Same for the error out and path out.

0 Kudos
Message 4 of 19
(4,838 Views)

works good

0 Kudos
Message 5 of 19
(4,830 Views)

(And naming a delimited spreasheet file with a *.xls extension as suggested by others also does not create an excel file.)

 


 

Hi Alten

             Run the code once and see before you criticize someone's work. 

Certified LabVIEW Developer
Best LabVIEW Programmer @NIDAYS 2015
0 Kudos
Message 6 of 19
(4,824 Views)

SanthoshJoel wrote: Run the code once and see before you criticize someone's work.

 It creates a plain dellimited text file with a fake .xls extension. This does not make it an excel file!!!

 

Just because the false extension causes the OS to open it with excel when double-clicked AND windows explorer shows it with an excel icon because it is fooled by the fake extension AND excel tries its best to interpret the file contents and display it in excel, it still does NOT make it an excel file. (it will also only work with a small subset of delimiters).

 

To create a real excel file you need very different tools.

 

Open a fake and a real *.xls file in notepad and you'll immediately see the difference.

 

It is ill advised to mismatch extensions because it confuses the issues. For example if you would later save it as a real excel file and then try to read it using "read delimited spreadsheet file", it will fail miserably. (try it once!).

 

Message 7 of 19
(4,815 Views)

I hope the issue which you are mentioned is resolved in LV2015

 

And by the way every labview user knows that its a fake .xls file. So forget that buddy

Message 8 of 19
(4,805 Views)

@santhoshbalaji wrote:

I hope the issue which you are mentioned is resolved in LV2015

 


Who is "you" and what "issue" are you talking about? Please quote relevant sections of the discussion to avoid confusion.


@santhoshbalaji wrote:

 

And by the way every labview user knows that its a fake .xls file.


Sure, and next time you want to watch a movie, just place a book into the DVD player. 😄 There also is at least one labview user who does not know that, thus disproving your statement. 😄


@santhoshbalaji wrote:

So forget that buddy


If I would forget that, I would also be one of these users. Your statement makes no sense at all in this context. 😄

Who is buddy? Are you confusing me with @BuddyHaun? 😮

 

0 Kudos
Message 9 of 19
(4,797 Views)

Sorry Altenbach,

 

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

 

Good luck keep arguing

0 Kudos
Message 10 of 19
(4,793 Views)