User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 427,092 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,260 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums

Open Excel file from Visual Basic

Join Date: Mar 2006
Posts: 5
Reputation: seagull is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
seagull seagull is offline Offline
Newbie Poster

Re: Open Excel file from Visual Basic

  #8  
Mar 22nd, 2006
Originally Posted by manal
No......it dose have value
i want to write program that read the names of student of specific section from excel file and display it in textbox

actually each cell has name of student


Not sure if you've solved this yet. I had exactly the same problem. Got this to work eventually. I needed to explicitly declare a1 as a range

Dim xlApp As Excel.Application = New Excel.Application
xlApp.DisplayAlerts = False
xlApp.Workbooks.Open("c:\test.xls")
Dim xlSht As Excel.Worksheet = xlApp.Sheets(1)
Dim xlRng As Excel.Range = xlSht.Cells(1, 1)
Textbox1.Text = xlRng.Value

Dan
Reply With Quote  
All times are GMT -4. The time now is 5:17 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC