I have a vb.net class library named ExcelReports.dll. I am able to compile it into a dll with no errors. I need to import it into my project.
The class library has the following code structure:
Imports System.IO
Imports System.IO.Directory
Imports System.IO.File
Imports Microsoft.Office.Interop.Excel
Imports System.Runtime.InteropServices
Imports System.Windows.Forms
Namespace modExcelFuncs
Module ExcelFuncs
.
.
.
End Module
End Namespace
So I have code like this at the top of my code that imports the class library's namespace: Imports ExcelReports.modExcelFuncs
Within the class library, I have constants, a class, and functions. Here is an example of each:
Public Const xlTEXT = "@"
Public Const xlGENERAL_TEXT = "General"
Public Class clsPrtSetup
Public psPrintTitleRows As String
Public psLeftMargin As Double
Public psRightMargin As Double
Public psTopMargin As Double
Public psBottomMargin As Double
Public psHeaderMargin As Double
Public psFooterMargin As Double
Public psOrientation As integer
Public psPaperSize As integer
Public psZoom As Integer
Public psDestination As string
End Class
public Function Zero_Fill ( ByRef strString as string, byref length As Integer ) As string
Dim strReturn As string = strString.Trim()
do while strReturn.length < length
strReturn = "0" & strReturn
loop
Return strReturn
end function
Every reference to anything in the class library results in a compile error. For example, in one of my winforms' code, I have the following code:
.Columns ("A:C").Select
.Selection.NumberFormat = xlTEXT
When I build the solution, I get this error for the xlTEXT reference:
xlText is not declared. It may be inaccessible due to its protection level.
Does anyone know what I need to do? I have included the ExcelReports.dll as one of the references of my project's "MyProject" section. From what I've seen in another application that I have that does a similar thing, all I need to do is the import of the <dll>.<namespace> and then I should be able to reference it's parts.
Thanks in advance for your assistance,
Jerry Scannell
The class library has the following code structure:
Imports System.IO
Imports System.IO.Directory
Imports System.IO.File
Imports Microsoft.Office.Interop.Excel
Imports System.Runtime.InteropServices
Imports System.Windows.Forms
Namespace modExcelFuncs
Module ExcelFuncs
.
.
.
End Module
End Namespace
So I have code like this at the top of my code that imports the class library's namespace: Imports ExcelReports.modExcelFuncs
Within the class library, I have constants, a class, and functions. Here is an example of each:
Public Const xlTEXT = "@"
Public Const xlGENERAL_TEXT = "General"
Public Class clsPrtSetup
Public psPrintTitleRows As String
Public psLeftMargin As Double
Public psRightMargin As Double
Public psTopMargin As Double
Public psBottomMargin As Double
Public psHeaderMargin As Double
Public psFooterMargin As Double
Public psOrientation As integer
Public psPaperSize As integer
Public psZoom As Integer
Public psDestination As string
End Class
public Function Zero_Fill ( ByRef strString as string, byref length As Integer ) As string
Dim strReturn As string = strString.Trim()
do while strReturn.length < length
strReturn = "0" & strReturn
loop
Return strReturn
end function
Every reference to anything in the class library results in a compile error. For example, in one of my winforms' code, I have the following code:
.Columns ("A:C").Select
.Selection.NumberFormat = xlTEXT
When I build the solution, I get this error for the xlTEXT reference:
xlText is not declared. It may be inaccessible due to its protection level.
Does anyone know what I need to do? I have included the ExcelReports.dll as one of the references of my project's "MyProject" section. From what I've seen in another application that I have that does a similar thing, all I need to do is the import of the <dll>.<namespace> and then I should be able to reference it's parts.
Thanks in advance for your assistance,
Jerry Scannell