K Feening
asked on
Vb.net Excel Spread Sheet
Hi I am using Vb.net and I need to create an Excel Spreadsheet dynamically with Columns for name and 4 for data validation im using the folllowing
How do I create the required Excel sheel
Imports System.Data.SqlClient
Imports System.Data.Sql
Imports System.Xml
Imports System.Data
Imports System.Configuration
Imports System.Windows.Forms
Imports Microsoft.Office.Interop
Imports Microsoft.Office.Interop.Excel
Imports System.Runtime.InteropServices
Imports Microsoft.Office
Imports System.IO
Imports System.Text
Private Sub bExport_Click(sender As System.Object, e As System.EventArgs) Handles bExport.Click
Dim xlApps As Excel.Application
Dim xlWorkBooks As Excel.Workbook
Dim xlWorkSheets As Excel.Worksheet
Dim misValues As Object = System.Reflection.Missing.Value
xlApps = New Excel.ApplicationClass
xlWorkBooks = xlApps.Workbooks.Add(misValues)
xlWorkSheets = xlWorkBooks.Sheets("sheet1")
Dim FiletoOpen As String = "FredFlinstone.xlsx"
xlWorkSheets.SaveAs(FiletoOpen)
xlWorkBooks.Close()
xlApps.Quit()
End Sub
How do I create the required Excel sheel
ASKER
Thanks Andrei didn't explain my self correctly need to find how to create the data validation drop downs in vb.net
found article explaining thanks again
https://stackoverflow.com/questions/44954793/vb-net-inserting-data-validation-in-excel-cell
found article explaining thanks again
https://stackoverflow.com/questions/44954793/vb-net-inserting-data-validation-in-excel-cell
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
xlWorkseet1.Name = "newName"