CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 1999
    Location
    Québec (Canada)
    Posts
    210

    User-defined type not defined

    I try to use an Excel app but each time I put
    Dim xlApp As Excel.Application
    I receive this error "user-defines type not defined" Why ?

    this is my code

    Public Sub ExportToExcel(Rs As Recordset, FileName As String)

    Dim xlApp As Excel.Application
    Dim xlBook As Excel.Workbook
    Dim xlSheet As Excel.Worksheet
    'Instantiate your Excel Objects

    Set xlApp = New Excel.Application
    Set xlBook = xlApp.Workbooks.Add()
    Set xlSheet = xlBook.ActiveSheet
    Dim iRow As Integer
    Dim iCol As Integer



    Thanks
    Redg


  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: User-defined type not defined

    Have you set a reference to Excel in the Project->References menu ?

    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured