Click here to Skip to main content
15,906,569 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Answercross-post alert Pin
Luc Pattyn16-May-11 22:57
sitebuilderLuc Pattyn16-May-11 22:57 
QuestionVB6 Help me! Pin
amoo201116-May-11 7:01
amoo201116-May-11 7:01 
AnswerRe: VB6 Help me! Pin
Dave Kreskowiak16-May-11 7:21
mveDave Kreskowiak16-May-11 7:21 
GeneralRe: VB6 Help me! Pin
Thomas Krojer16-May-11 21:19
Thomas Krojer16-May-11 21:19 
AnswerRe: VB6 Help me! Pin
Dalek Dave17-May-11 12:24
professionalDalek Dave17-May-11 12:24 
Questioncreate a wizard query Pin
kouku16-May-11 3:19
kouku16-May-11 3:19 
AnswerRe: create a wizard query Pin
Dave Kreskowiak16-May-11 4:12
mveDave Kreskowiak16-May-11 4:12 
QuestionRead Excel File Pin
rupeshkp72815-May-11 4:42
rupeshkp72815-May-11 4:42 
I want to read excel sheet cells.
I have written the following code in Visual Basic 2005 in single desktop environment with no net connectivity:
Public Class Form1

    Public xl As New Excel.Application
    Public xlsheet As Excel.Worksheet
    Public xlwbook As Excel.Workbook
    Public j As Integer

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        MsgBox("Hello")

        xlwbook = xl.Workbooks.Open("D:\sample.xls")
        xlsheet = xlwbook.Sheets.Item(1)

        TextBox1.Text = xlsheet.Cells(2, 1) ' row 2 col 1
        TextBox2.Text = xlsheet.Cells(2, 2) ' row 2 col 2 


        xl.ActiveWorkbook.Close(False, "D:\sample.xls")
        xl.Quit()
    End Sub
End Class


I am getting the errors as:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\Vbc.exe /noconfig /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Data,System.Drawing,System.Diagnostics,System.Windows.Forms /nowarn:42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 /rootnamespace:VBCheck /doc:obj\Debug\VBCheck.xml /define:"CONFIG=\"Debug\",DEBUG=-1,TRACE=-1,_MyType=\"WindowsForms\",PLATFORM=\"AnyCPU\"" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll,C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Deployment.dll,C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll,C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll,C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll,C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /main:VBCheck.My.MyApplication /debug+ /debug:full /out:obj\Debug\VBCheck.exe /resource:obj\Debug\VBCheck.Form1.resources /resource:obj\Debug\VBCheck.Resources.resources /target:winexe Form1.vb Form1.Designer.vb "My Project\AssemblyInfo.vb" "My Project\Application.Designer.vb" "My Project\Resources.Designer.vb" "My Project\Settings.Designer.vb"


error BC30002: Type 'Excel.Application' is not defined.
error BC30002: Type 'Excel.Worksheet' is not defined.
error BC30002: Type 'Excel.Workbook' is not defined.



How to get rid of this error?
AnswerRe: Read Excel File Pin
Simon_Whale15-May-11 5:22
Simon_Whale15-May-11 5:22 
AnswerRe: Read Excel File Pin
RobCroll16-May-11 18:32
RobCroll16-May-11 18:32 
AnswerRe: Read Excel File Pin
alainmarccavenaile18-May-11 22:28
alainmarccavenaile18-May-11 22:28 
QuestionSVN commit single file or project folder Pin
cages14-May-11 11:48
cages14-May-11 11:48 
AnswerRe: SVN commit single file or project folder Pin
RobCroll16-May-11 18:28
RobCroll16-May-11 18:28 
GeneralRe: SVN commit single file or project folder Pin
cages17-May-11 11:49
cages17-May-11 11:49 
AnswerRe: SVN commit single file or project folder Pin
David Mujica17-May-11 8:47
David Mujica17-May-11 8:47 
QuestionHow do I use the ribbon? Pin
VB_ Coder14-May-11 7:15
VB_ Coder14-May-11 7:15 
QuestionDistribution periods for teachers With Rnd -vb6 Pin
Ebrahem B Alabdaly12-May-11 5:45
Ebrahem B Alabdaly12-May-11 5:45 
AnswerRe: Distribution periods for teachers With Rnd -vb6 Pin
Simon_Whale12-May-11 6:10
Simon_Whale12-May-11 6:10 
AnswerRe: Distribution periods for teachers With Rnd -vb6 Pin
Eddy Vluggen13-May-11 7:23
professionalEddy Vluggen13-May-11 7:23 
AnswerRe: Distribution periods for teachers With Rnd -vb6 Pin
Joshi, Rushikesh12-May-11 22:07
professionalJoshi, Rushikesh12-May-11 22:07 
AnswerRe: Distribution periods for teachers With Rnd -vb6 Pin
Eddy Vluggen13-May-11 7:28
professionalEddy Vluggen13-May-11 7:28 
QuestionHow to check whether CD inesrted into CDDrive or not and how to check the CD free space and used space in VB6 Pin
sandeep sangshetty11-May-11 19:27
sandeep sangshetty11-May-11 19:27 
QuestionError while executing WMI query to check whther CD inserted or not Pin
sandeep sangshetty11-May-11 19:00
sandeep sangshetty11-May-11 19:00 
Questionscript for MS Word 2003 doesn't work for Word 2007 Pin
Member 791550011-May-11 5:05
Member 791550011-May-11 5:05 
AnswerRe: script for MS Word 2003 doesn't work for Word 2007 Pin
Dave Kreskowiak11-May-11 6:19
mveDave Kreskowiak11-May-11 6:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.