NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Active Participant
jcarmody
Posts: 1,595

Re: Inserting new data to a new row in same Excel sheet continuously

Replace the Open New Worksheet function (so it doesn't make a new worksheet when you open the Workbook) then you need to find the next row to write in (unless you want to replace data).  I've written a VI that does this and replaced the Row constant with the next row from the last time the Workbook was saved.

 

La_BD.png

Jim
CLD
Member ery
Member
ery
Posts: 18
0 Kudos

Re: Inserting new data to a new row in same Excel sheet continuously

Can you please include the open specific worksheet.vi for me? since I don't know why I couldn't open that VI

thanks a lot Jim, you are the best ^^

 

thanks again,

Ery

Member ery
Member
ery
Posts: 18
0 Kudos

Re: Inserting new data to a new row in same Excel sheet continuously

Thanks, Problem solved!!

 

Thanks Jim ^^

Member ery
Member
ery
Posts: 18
0 Kudos

Re: Inserting new data to a new row in same Excel sheet continuously

Hi Jim, Sorry to bother you again, I just wonder how do you connect the get next xl row.vi to the cell value? I try to use the function you posted, but it's now working, I actually need to get next xl column instead or row, since I need the output value to excel set to next column everytime I finished recording and save the excel and run it again.

 

thanks again,

Ery

Active Participant
jcarmody
Posts: 1,595

Re: Inserting new data to a new row in same Excel sheet continuously

Hi, Ery.

 

I'm not sure I understand what's not working, but you can rewire the output from the attached VI and it will give you the next column number.  I've modified it to return the next column as well as row.

 

Jim

Jim
CLD
Member ery
Member
ery
Posts: 18
0 Kudos

Re: Inserting new data to a new row in same Excel sheet continuously

Hi Jim, 

 

I try to wire the output of get next row & column but it couldn't be connected, I attached the picture and my vi

 

thanks,

Ery

 

Active Participant
jcarmody
Posts: 1,595

Re: Inserting new data to a new row in same Excel sheet continuously

Oops.  I don't know when it happened, but there was a class conflict.  I had the terminal wired incorrectly, but that doesn't tell me how the type changed.  Anyway, here's a corrected VI.

 

You may also need to modify the wiring a bit to get the

 

La_BD.png

 

or, this

 

La_BD.png

 

depending on what you're trying to do.  Regardless, you can't set the column tunnel to Use Defaults if Empty because you'll get a zero every time after the first loop.  Use a Shift Register to carry it back around.

Jim
CLD
Member ery
Member
ery
Posts: 18
0 Kudos

Re: Inserting new data to a new row in same Excel sheet continuously

Yeap, thanks, it's working now, but the system seems a bit wierd, I attached the picture show how exactly what I need when run and stop then run again this vi which show the result on excel

 

Thanks,

Ery

Active Participant
jcarmody
Posts: 1,595

Re: Inserting new data to a new row in same Excel sheet continuously

[ Edited ]

You need to understand how the Shift Register works with the Case Structure.  The True case is where you put the initial Row,Column pair.  You want the row to always start at 1 and the column to start with whichever is next.  The false case is where you'll increment the cell position.  You want the row to increment and the column to stay the same.  As Nike says: "Just do it."

 

La_BD.png

Jim
CLD
Member ery
Member
ery
Posts: 18
0 Kudos

Re: Inserting new data to a new row in same Excel sheet continuously

Thanks Jim, Just as you said, I put it that way, but I keep getting the next row(1048577) and Next Column(16385) which is nothing show on the excel



Ery

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page