LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read a particular column in excel spreadshee​t

Solved!
Go to solution

HeyBen,

Im havving trouble understand what you mean there. So when i open my csv file, i am  copying the content using range which then go back out through the spreadsheet into the save workbook. Not exactly sure how i can open a template after that. I apologize, you have me confused. I'll spend some time on this and get back to you. Happy New Years guys and thanks for all your help!

 

0 Kudos
Message 31 of 37
(1,929 Views)

XxLinkxX a écrit :

HeyBen,

Im havving trouble understand what you mean there. So when i open my csv file, i am  copying the content using range which then go back out through the spreadsheet into the save workbook. Not exactly sure how i can open a template after that. I apologize, you have me confused. I'll spend some time on this and get back to you. Happy New Years guys and thanks for all your help!

 


When you open the csv file in Excel the application takes care of the data type conversion (when data type is recognizable, Excel cell format will probably be General in your case), it opens as a temporary workbook (it is not saved yet and doesn't need to be).

 

You can copy the contained data to the clipboard using the Range Copy method. You now open your template (this should be a xltx file). When an xltx file is called Excel opens it as an xlsx file that contains the formatting of the xltx file (the new file will have the name "TemplateName1"), Once opened, select the range where you want the data copied and use the worksheet paste method to paste the values in it. Then save this new workbook as an xlsx file with the  name you want.

 

Ben64

Message 32 of 37
(1,917 Views)

Hey Ben,

Thanks for VI, It helps alot. I wouldnt have known to open the template as well. When i was trying to open the csv file i was trying to copy and paste with the template without opening it. I was using add template. No wonder i was having an issue. Also, one minor question i had was when using the save workbook, what does xlExclusive mean for accessmode with a constant 2 for the conflict resolution? Is that having to do with the file extension? Thanks again!

0 Kudos
Message 33 of 37
(1,865 Views)
Solution
Accepted by XxLinkxX

 

The ConflictResolution set to 2 is to always accept local user modification. With setting DisplayAlerts to False you will not receive any notification (if you use the same name as an existing file it will overwrite it without warning popup). xlExclusive access mode is probably not necessary and could be removed (thus using the default access mode), exclusive access is used to avoid other user modifiying the file. It has nothing to do with the file extension.

 

Ben64

Message 34 of 37
(1,856 Views)

Thanks Ben! Learning alot from you and your style. Would you reccomend me to some good labview tutorials/classes.hopefullly free ones. I find the one on labview a tad pricy.

0 Kudos
Message 35 of 37
(1,845 Views)

Have a look at the 3rd post of this thread, there is links to free online tutorials. Of course the forum is also a good source learning source.

 

http://forums.ni.com/t5/LabVIEW/Free-LabVIEW-Basics-and-Introduction-Courses-Removed-Moved-or/m-p/12...

 

Ben64

0 Kudos
Message 36 of 37
(1,839 Views)

Thanks Ben! Link 2 was not working but i believe i found it in search (3 Hour course). Hopefully they update it.

0 Kudos
Message 37 of 37
(1,822 Views)