×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Controlling CentreVue Supervisor with VBA code

Controlling CentreVue Supervisor with VBA code

Controlling CentreVue Supervisor with VBA code

(OP)
Hi all, before I spend allot if time trying to figure this out, I thought I'd ask if anyone knows how to tell CVS to connect and login to CMS using VB code.

I can get CVS to run a report using VBA code (macro in Excel), but I have to be logged into the CMS with CVS first.  Does anyone have example code of telling CVS to connect and login?

RE: Controlling CentreVue Supervisor with VBA code

Easiest way to do this is probably through some macro program, i.e. MacroAngel or Automate, that has VB hooks. So the VB program controls the macro program which controls the CentreVue program. Personally, I like MacroAngel better (more stable).

RE: Controlling CentreVue Supervisor with VBA code

(OP)
Thanks for your reply.  The Macro Angel program looks pretty cool, I will try it sometime.  For this project however, I would like to do it in all VB code.  Third party tools that cost money are not an option at this point.  I know I could write VB code to "Sendkeys" but I'd like to use the CVS classes instead.

RE: Controlling CentreVue Supervisor with VBA code

Danp129,
   I have used access to grab trunk group reports using Terranova and DDE. But I could only grab one page reports Terranova does not use the sendkey command so I cant page-down or cancel. I was not aware CentreVu Supervisor allowed DDE?? Connections. If so what reference are you using to initiate you connection with? Where could I get a list of  commands? Does CentreVu Terminal also accept DDE?

 Here is the code I wrote to log into my phone switch maybe you could port it over. This code uses two text boxes in an access form LoginID and Password.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Private Sub Command2_Click()
    Dim info As String, Login As String, Pass As String, chan As String, Count As String
    
    Login = LoginID
    Pass = Password
    
On Error Resume Next                           ' Set up error handling.
    chan = DDEInitiate("TCOM", "COM1")         ' Establish link.
        If Err Then                            ' If error occurs, TCOM may  not be running.
            Err = 0                            ' Reset error
            Shell "C:\TC\BIN\TCOM.EXE", 1      ' Start TCOM.
        If Err Then Exit Sub                   ' If another error, exit.
            chan = DDEInitiate("TCOM", "COM1") ' Establish TCOM link.
        End If

DDEExecute chan, "[MACROS 'PBXnoLO.scr']"      ' Run Script to configure TCOM.

    Count = 1
    
        DDEPoke chan, "SEND", "" & Login        ' Send LoginID

            While Count < 10000
                On Error Resume Next            ' Counter waits for password prompt
                Count = Count + 1
            Wend
        
        
    
        DDEPoke chan, "SEND", "" & Pass        ' Send Password
                  Count = 1
                  
            While Count < 10000
            On Error Resume Next               ' Counter waits for Terminal prompt
                Count = Count + 1
            Wend

        DDEPoke chan, "SEND", ""
        DDEPoke chan, "SEND", ""
        DDEPoke chan, "SEND", ""
    DDETerminate (chan)
End Sub

+++++++++++++++++++++++++++++++++++++++++++++++++
PBXnoLO.scr Configures my Emulator itlooks like this.
+++++++++++++++++++++++++++++++++++++++++++++++++

BAUD 9600
PARITY NONE
WORDSZ 8
STOPBIT 1
S_HANDSHAKE XON/XOFF dc1 dc3
DELAY_BAUD 9600
SETBREAK 50
DUPLEX FULL
EMULATOR 513
REM_CMD ON
WRAPAROUND OFF
COLORS BKG(0,64,64) NORM(255,255,255) BLINK(255,255,255) BRIGHT(255,255,255) SUBD(255,255,255)
PROTOCOL TERRANOVA_B
PROTO_ESC 13 27
DEVICE "HAYES"
DIAL "?????"               <-****Enter number here
WAIT 4 "login: "
STOP

++++++++++++++++++++++++++++++++++++++++++++++++++

 Sorry about the formatting I will Email it to you if its a pain to read. Its not the best code I've written, but it gets the job done.

VLG711

RE: Controlling CentreVue Supervisor with VBA code

(OP)
The last time I used Terranova, it didn't support telnet so I abondoned it (have a CLAN and like to take advantage of it). I haven't used the newest terminal emulator that comes with DSA 1.10, I've heard is suppports scripting, but not VB scripting.  

 I use Reflection for any special exports from my switch that DSA doesn't support (like exporting every step in every vector saving it to Excel, then to Word and saving as HTML with links).  I'll send you the code for this if you want to download the WRQ Reflection for Unix/Open VMS evaluation.

 After manually logging into CetreVu Supervisor, I can run CMS reports using VB programming from Excel.  I'll send you the spreedsheet for this code that pulls CMS trace reports and exports them as files (you could also copy to clip board and paste the info to another sheet or print them if you change a little code).  It'll make more sense if you see the spreadsheet. Note that the index number for a single report could be found with very little code instead of using the "RefreshCatalogindex" sub, but I lost the command for that :( .. E-mail me at dan129<spamfilter>@swbell.net and I'll send you the spreadsheet that is used for this code. Here's the code (to give you an Idea of how I'm controlling it, it's useless without the spreadsheet)...


Public rpttype, IndexNum, ReportLocation As Range
Public CentreVuOpen As Integer
Dim Adtlfntxt, Counter1, DateOffset, ExportDir, AgentID, AgentName, TimeFrame As String
Sub ExportAgentTrace()

Call RefreshCatalogIndex 'If a report is added or deleted, the index number may change

    On Error GoTo StopReports
    Dim cvsApp As New cvsApplication
    Dim cvsSrv As New cvsServer
    Dim cvsCatalog As New cvsCatalog
    Dim cvsRpt As New cvsReport
    Set cvsApp = CreateObject("cvsup.cvsApplication")
    
    CentreVuOpen = cvsApp.Servers.Count
    
    If (CentreVuOpen > 0) Then
        Set cvsSrv = cvsApp.Servers.Item(1)
    Else
        GoTo StopReports
    End If

    Set cvsCatalog = cvsSrv.Reports
    cvsSrv.Reports.ACD = 1
    
'Set Variables

'Adtlfntxt, DateOffset, ExportDirectory, AgentID, AgentName,
'TimeOffset, IndexNumber are named ranges in Excel
    
    IndexNum = Range(Range("IndexNumber").Address).Offset(1, 0).Value
    ExportDir = Range("ExportDirectory").Value
    DateOffset = Range("DateOffset").Value
    TimeFrame = Range("TimeFrame").Value
    Adtlfntxt = Range("AdtlFnTxt").Value 'Additional info added to filename (currently the Date + DateOffset)
    Counter1 = 0

'Start the loop
    Do Until Range("AgentID").Offset(Counter1 + 1, 0).Value = "" 'If there are no more Agent ID's, the loop will stop.

'increase counter
        Counter1 = Counter1 + 1
        
'reset varibles based on new counter value
        AgentID = Range("AgentID").Offset(Counter1, 0).Value 'Used to fill in value on the report (and currently part of the file name).
        AgentName = Range("AgentName").Offset(Counter1, 0).Value 'Currently used as part of the filename

'open the report
        cvsCatalog.CreateReport cvsCatalog.Reports.Item(IndexNum), cvsRpt
        
'Input values on the form
        If (cvsRpt.SetProperty("Agent", AgentID) And _
            cvsRpt.SetProperty("Dates", DateOffset) And _
            cvsRpt.SetProperty("Times", TimeFrame)) Then
        Else
            GoTo StopReports
        End If

'Run the report
        cvsRpt.Run

'What to do with the report, i.e. Export, Copy Values, Print, and if an Export, what directory/filename.
'Record a script withing CVS, open it with notepad and compare
'the line that starts with b = to the following line:
        cvsRpt.ExportData ExportDir & "\" & AgentID & " - " & AgentName & Adtlfntxt & ".txt", 44, 1, False, True, True
        
'Close the report
        cvsRpt.Quit
    Loop
    
    Set cvsRpt = Nothing
    Set cvsCatalog = Nothing
    Set cvsSrv = Nothing
    Set cvsApp = Nothing
    Exit Sub
    
StopReports:
        Set cvsRpt = Nothing
        Set cvsCatalog = Nothing
        Set cvsSrv = Nothing
        Set cvsApp = Nothing
                   
End Sub
Sub RefreshCatalogIndex()

    Application.Calculation = xlManual
    Sheets("Report Catalog").Select
    Range("A1:A500").ClearContents
    On Error GoTo StopReports
    Dim CentreVuOpen As Integer
    Dim cvsApp As New cvsApplication
    Dim cvsSrv As New cvsServer
    Dim cvsCatalog As New cvsCatalog
    Dim cvsRpt As New cvsReport
    Dim cellnum As Integer
            
    Set cvsApp = CreateObject("cvsup.cvsApplication")
        
    CentreVuOpen = cvsApp.Servers.Count
    If (CentreVuOpen > 0) Then
        Set cvsSrv = cvsApp.Servers.Item(1)
    Else
    GoTo StopReports
    End If

    Set cvsCatalog = cvsSrv.Reports
    cvsSrv.Reports.ACD = 1
       
    cellnum = 0
    Do
    cellnum = cellnum + 1
    Excel.Application.Range("a" & cellnum).Value = cvsCatalog.Reports(cellnum).Key
    Loop Until cellnum = cvsCatalog.Reports.Count
    Sheets("Metric Reports").Select
    Application.Calculation = xlAutomatic
on_exit:
    Set cvsRpt = Nothing
    Set cvsCatalog = Nothing
    Set cvsSrv = Nothing
    Set cvsApp = Nothing
    Exit Sub
    
StopReports:
        Set cvsRpt = Nothing
        Set cvsCatalog = Nothing
        Set cvsSrv = Nothing
        Set cvsApp = Nothing
                   
End Sub

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close