aadams8918
New member
- Joined
- Apr 12, 2004
- Messages
- 3
I am trying to create an Excel worksheet from .Net. I found some code from another thread, but when I use it - I am getting an error. Please help.
(This is the Code)
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
xlApp = CType(CreateObject("Excel.Application"), Excel.Application)
xlBook = CType(xlApp.Workbooks.Add, Excel.Workbook)
xlSheet = CType(xlBook.Worksheets(1), Excel.Worksheet)
(Error message)
Type Excel.Application is not defined.
I assume that I need an import statement for this, but not sure.
(This is the Code)
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
xlApp = CType(CreateObject("Excel.Application"), Excel.Application)
xlBook = CType(xlApp.Workbooks.Add, Excel.Workbook)
xlSheet = CType(xlBook.Worksheets(1), Excel.Worksheet)
(Error message)
Type Excel.Application is not defined.
I assume that I need an import statement for this, but not sure.