I want to create a VB.NET application that creates an Excel File. Currently I have installed Office 2007.
Most examples I found on the web uses office 2003 objects library. Some, like the link below, uses Excel 9.0 Object Library.
http://www.vbdotnetheaven.com/UploadFile/ggaganesh/ExcelSpreadsheet04182005093012AM/ExcelSpreadsheet.aspx?ArticleID=14bf0d5f-a633-42da-ab3a-0a95dc974554
I have read about the Primary Interop Assemblies and have downloaded for Office version 2003.
I have tried the code provided on the link above but it doesnt seem to run on my machine.
All I wanted to do was to create an excel file where I can define any name I want even if there was no Office installed in the machine where this supposedly program will be installed.
I need to know the specific steps that I need to take and of course a sample code on how to do it.
Thanks.
http://msdn2.microsoft.com/en-us/library/aa432112.aspx
You will need to reference the office 2007 object library.
The example shown in the website is:
Application.NewDocument.Ad
Section:=msoNew, DisplayName:="New Document"
CommandBars("Task Pane").Visible = True
It has references for creating an excel file. Change the Application.NewDocument to Application.NewWorkbook.