Link to home
Start Free TrialLog in
Avatar of holemania
holemania

asked on

Pass Values from VB.Net application to Excel Template and back to the application?

I am in need of assistance in passing values from a VB.Net application to an Excel spreadsheet template and than be able to pass it back to the program for editing.  

Here's an overview of the process and what I want to accomplish.  I want to create a vb.net program that has the similar form or template as the Excel spreadsheet template, when a person creates a new form and save it will insert the values from the program to the Excel template.  If they open an existing form (Using conditions to determine if it's a new or existing form), the program will pull the value from the Excel spreadsheet and populate the application for editing.  I think that if they hit "New" to create a new form, it will default to the template otherwise it will use the existing Excel spreadsheet for this.

Summary:

1)  How would I pass value from VB.Net application to an existing Excel Template?  Please provide example of opening the Template and than passing from VB.Net application to the template.  For example txtFName will be pass to cell A1, txtLName to cell B1, etc....

2)  If the user opens an existing excel spreadsheet, how would I read the excel spreadsheet and pass it to the application for editing?  For example the spreadsheet A1 has value "Jon", how would I pass that to textbox txtFName?
ASKER CERTIFIED SOLUTION
Avatar of Kudzullc
Kudzullc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of holemania
holemania

ASKER

Sorry for getting back so late.  I was on Vacation and just got back.

It is working, but can you give me an example of opening a template?  For example we have an existing Excel spreadsheet that I want to pass the value to each cell.
holemania,
Do you mean opening a template fromVB?  I dont know if you can do that but I may be wrong.  Which really only means i have never done it before.  

gl,
Lucas
I figured it out.  I meant opening a Excel template.  See I want to use an existing template and fill that template with values from the VB application.  I switched to VB and not VB.Net because we were having some issues with trusting the assembles so it seems to work out with your example.  Just need to tweak it a little.

Thanks.
Great!

Thanks for the points.

gl,
Lucas