Creating a Data Source

M

Mel

I have Visual Basic code in the Page_Load event that makes a
connection to an Excel 11.0 file. Is it possible to do the equivalent
using a data source so it existed on the form? If so, how? A data
source would be handy since I need to retrieve the Excel data from
many procedures/functions in my VB code.

Dim appExcel As New Excel.Application
Dim wkbExcel As Excel.Workbook

appExcel = CreateObject("Excel.Application")
appExcel.Visible = False
wkbExcel = appExcel.Workbooks.Add("c:\support\Span Tables.xls")
 
M

Mark Rae [MVP]

I have Visual Basic code in the Page_Load event that makes a
connection to an Excel 11.0 file. Is it possible to do the equivalent
using a data source so it existed on the form? If so, how? A data
source would be handy since I need to retrieve the Excel data from
many procedures/functions in my VB code.

Dim appExcel As New Excel.Application
Dim wkbExcel As Excel.Workbook

appExcel = CreateObject("Excel.Application")
appExcel.Visible = False
wkbExcel = appExcel.Workbooks.Add("c:\support\Span Tables.xls")

This cannot be done in ASP.NET, as server-side Office Automation doesn't
work - Microsoft will not support any solution which attempts to do this...
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2

Instead, use ADO.NET or Aspose:
http://www.google.co.uk/search?sour...rlz=1T4GGIH_en-GBGB220GB220&q=Excel+"ADO.NET"
http://www.aspose.com/Products/Aspose.Cells/Default.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,109
Latest member
JanieMalco
Top