09-16-2010 08:04 AM
Hi guys,
I need to insert a new cell into a specific worksheet. My application runs only for one worksheet(see sample.xls),if I have more worksheet(see sample1.xls) it doesn't work.If you have an idea it will be great.
Thanks to all, Samoth
Solved! Go to Solution.
09-16-2010 08:13 AM
So do you need to open all XLS files in some folder and insert this cell?
09-16-2010 08:18 AM
sample1.xls does not have a tab called sample. so when it opens the xls file it never finds the wooksheet that you are trying to add a cell to. I need to know more information to be able to help you figure out what you need.
09-16-2010 09:12 AM - edited 09-16-2010 09:13 AM
@aeastet wrote:
sample1.xls does not have a tab called sample.
Indeed. Can't access a sheet that doesn't exist. And, the error you get tells you the answer: the description says "Invalid index." Did you run the code in highlight mode? You would have seen the "Sheets -> Item" method generating that error.
09-16-2010 11:33 PM
Hi all,
Even changing the sheet name(as, sheet1, sheet2) does not solve the problem all the time. When i remove the method called "Select" used after the cell position setting, I found its working fine for all the sheets.
Any Idea?
09-17-2010 12:36 AM
No, in sample1.xls try with one of its worksheet (Sheet1, Sheet2 or Sheet3), not with WSheet sample.
I' ve started with workbook sample.xls , if you run the VI , as you can see I can insert a new cell . I wish to do the same in case of sample1.xls choosing one of its worksheet.
Thanks, Samoth
09-17-2010 12:36 AM
No, in sample1.xls try with one of its worksheet (Sheet1, Sheet2 or Sheet3), not with WSheet sample.
I' ve started with workbook sample.xls , if you run the VI , as you can see I can insert a new cell . I wish to do the same in case of sample1.xls choosing one of its worksheet.
Thanks, Samoth
09-17-2010 12:39 AM
Exactly
09-17-2010 04:01 AM
After a quick play with this, I think there seems to be some problem with the way you select the worksheet you wish to use.
If I save the spreadsheet with Sheet3 at the front, I can then insert cells into Sheet 3, but not into Sheet1 or Sheet2.
If I save the spreadsheet with Sheet1 at the front I can insert cells into Sheet1 etc...
Looking here there is some advice on how to do what you are trying to but it looks to me as though this is what you've done.
Maybe have a play with different ways of indexing your worksheet and see if that helps.
09-17-2010 07:15 AM