LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing to a cell in an existing Excel file without prompt of overwriting

Solved!
Go to solution

I am trying to learn communicating with Excel spreadsheet via ActiveX. I started with the Labview example "Write Table to XL", however, this example creates new file which is not my case of overwriting an existing Excel spreadsheet. So, I made my changes to the VI to overwrite an existing file with my new value. Unfortunately, there is always prompt of overwriting the file, and even though I press "yes", the file keeps unchanged.

 

The help I need is to kindly :

 

1- check my attached VI for any mistakes

2- make the VI overwriting the file without any prompts

 

Thanks in advance

0 Kudos
Message 1 of 13
(6,581 Views)

Can you save it in LV2009?

 

Ben64

0 Kudos
Message 2 of 13
(6,555 Views)

Sure, and thanks for your help.

 

0 Kudos
Message 3 of 13
(6,543 Views)

You need to also include the subvi you modified.

 

Ben64

0 Kudos
Message 4 of 13
(6,541 Views)

(Didn't had enough time to complete the edit)

 

You need to also include the subvi you modified.

 

You are using the OpenBook vi from the Write Table to XL exemple. Since you didn't include the modified Open Book subVI my guess is that you are connecting your file path to the template input of the add method, that is probably why you can't save the changes. This vi is used to add a new workbook to the workbooks collection (it uses the add method). To open an existing workbook you need to use the workbook open method. Then you can pass this reference to the open sheet vi

 


Ben64

0 Kudos
Message 5 of 13
(6,538 Views)

I really appreciate your help, but I already changed the configuration to open a file path taking another ActiveX example as a reference. Here is my subVI's I used, but they are merged in LLB. I am sorry for my ignorance of how to extract all the subVI's from this file.

0 Kudos
Message 6 of 13
(6,527 Views)

I have tried to save each subVI in a new location and I got all of them separately. Hope they work, since I don't know how to check their compatibility for previous versions.

0 Kudos
Message 7 of 13
(6,525 Views)
Solution
Accepted by topic author Diaa Abidou

In your Open New Workbook.vi you have a Open/Create/Replace File.vi. You don't need that.

 

 

0 Kudos
Message 8 of 13
(6,508 Views)

@nyc_(is_out_of_here) wrote:

In your Open New Workbook.vi you have a Open/Create/Replace File.vi. You don't need that.

 

 


Thanks for your help, it works fine.

 

I would be grateful if you put links for learning the alternative ways of communicating with Excel instead of ActiveX such as ADO, since I tried to learn these ways but I didn't found clear instructive resources (i.e. tutorials, examples).

 

Thanks

0 Kudos
Message 9 of 13
(6,498 Views)

Diaa Abidou wrote:

 I would be grateful if you put links for learning the alternative ways of communicating with Excel instead of ActiveX such as ADO, since I tried to learn these ways but I didn't found clear instructive resources (i.e. tutorials, examples).

 

Thanks


Do you even understand what you are asking?

 

ADO = ActiveX Data Objects

 

 

0 Kudos
Message 10 of 13
(6,492 Views)