Presentation is loading. Please wait.

Presentation is loading. Please wait.

VB.NET and Excel VB.NET allows you to write code to manipulate Excel. You can create, open, and save Excel files. You can read data from Excel. You can.

Similar presentations


Presentation on theme: "VB.NET and Excel VB.NET allows you to write code to manipulate Excel. You can create, open, and save Excel files. You can read data from Excel. You can."— Presentation transcript:

1 VB.NET and Excel VB.NET allows you to write code to manipulate Excel. You can create, open, and save Excel files. You can read data from Excel. You can write data to Excel. You can create charts, pivot tables, and more. This can be very useful for generating output data in a widely-used format that is easy to display, print, and manipulate.

2 Can Be Tricky When it works, creating Excel files from VB is pretty easy. Unfortunately, it doesn’t always work, and I don’t know why. Therefore, I want to make you aware that you can do it, and show you how to do it… Assuming that it will work on the computer that you are using.

3 Adding a Reference To be able to manipulate Excel from a VB.NET program, you must add a reference to Excel.

4 Creating an Excel File Excel code doesn’t work well with Option Strict being On; therefore, I turned it off. This code creates a new Excel file and writes some data to it.

5 Modifying an Existing Excel File Locate the file using an OpenFileDialog or other means. After that, writing to an existing file is the same as to a new file.

6 Read From a File Connect to the file in the same way. Read the “value2” property of the Cells that you want to import into your program. All of these examples are in the “ExcelOutput.zip” program, available in today’s lecture materials.


Download ppt "VB.NET and Excel VB.NET allows you to write code to manipulate Excel. You can create, open, and save Excel files. You can read data from Excel. You can."

Similar presentations


Ads by Google