inzomiatic
New Member
- Joined
- Sep 12, 2015
- Messages
- 1
Hi,
I am working with a project for CMS which is macro, this is my code below:, however i am getting an error when trying to run the program, im getting an error of
Error:Compile error:
User-Defined type not defined.
Function CMSConn1(sUserID As String, sPassword As String, sServerIP As String, iDate As Date) <-- this line is highlighted on yellow.
any1 i need your help.
------------------------------------------------------------Code----------------------------------------------------------------------------
Option Explicit
Function CMSConn1(sUserID As String, sPassword As String, sServerIP As String, iDate As Date)
Dim cvsApp As cvsApplication
Dim cvsSrv As cvsServer
Dim cvsConn As cvsConnection
Dim iServer As Integer
Dim bConnected As Boolean
bConnected = False
Set cvsApp = New cvsApplication
Set cvsSrv = New cvsServer
Set cvsConn = New cvsConnection
'Checks to see if already connected to server
For iServer = 1 To cvsApp.Servers.Count
Set cvsSrv = cvsApp.Servers(iServer)
If cvsSrv.ServerKey Like "*\" & sServerIP & "\*\*\*" Then
bConnected = True
Exit For
End If
Next iServer
'Initiates connection if one not already established
If bConnected = False Then
If cvsApp.CreateServer(sUserID, sPassword, "", sServerIP, False, "ENU", cvsSrv, cvsConn) Then
If cvsConn.Login(sUserID, sPassword, sServerIP, "ENU") Then
End If
End If
End If
'Executes CMS report
Dim cvsRepInfo As Object
Dim cvsRepProp As Object
Dim cvsLog As Object
Dim b As Boolean
I am working with a project for CMS which is macro, this is my code below:, however i am getting an error when trying to run the program, im getting an error of
Error:Compile error:
User-Defined type not defined.
Function CMSConn1(sUserID As String, sPassword As String, sServerIP As String, iDate As Date) <-- this line is highlighted on yellow.
any1 i need your help.
------------------------------------------------------------Code----------------------------------------------------------------------------
Option Explicit
Function CMSConn1(sUserID As String, sPassword As String, sServerIP As String, iDate As Date)
Dim cvsApp As cvsApplication
Dim cvsSrv As cvsServer
Dim cvsConn As cvsConnection
Dim iServer As Integer
Dim bConnected As Boolean
bConnected = False
Set cvsApp = New cvsApplication
Set cvsSrv = New cvsServer
Set cvsConn = New cvsConnection
'Checks to see if already connected to server
For iServer = 1 To cvsApp.Servers.Count
Set cvsSrv = cvsApp.Servers(iServer)
If cvsSrv.ServerKey Like "*\" & sServerIP & "\*\*\*" Then
bConnected = True
Exit For
End If
Next iServer
'Initiates connection if one not already established
If bConnected = False Then
If cvsApp.CreateServer(sUserID, sPassword, "", sServerIP, False, "ENU", cvsSrv, cvsConn) Then
If cvsConn.Login(sUserID, sPassword, sServerIP, "ENU") Then
End If
End If
End If
'Executes CMS report
Dim cvsRepInfo As Object
Dim cvsRepProp As Object
Dim cvsLog As Object
Dim b As Boolean