Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

Creating a Data Source

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mel - 10 Jul 2007 16:04 GMT
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")
Mark Rae [MVP] - 10 Jul 2007 16:46 GMT
>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
[quoted text clipped - 8 lines]
> 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?sourceid=navclient&aq=t&hl=en-GB&ie=UTF-8&rlz=1T4
GGIH_en-GBGB220GB220&q=Excel+%22ADO%2eNET%22

http://www.aspose.com/Products/Aspose.Cells/Default.aspx

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.