Results 1 to 4 of 4

Canceling on Input Box

Threaded View

Slang22 Canceling on Input Box 03-11-2019, 05:44 PM
Roel Jongman Re: Canceling on Input Box 03-11-2019, 06:08 PM
Slang22 Re: Canceling on Input Box 03-11-2019, 06:14 PM
Keebellah Re: Canceling on Input Box 03-11-2019, 06:11 PM
  1. #1
    Registered User
    Join Date
    03-11-2019
    Location
    Woodland Hills
    MS-Off Ver
    2016
    Posts
    2

    Canceling on Input Box

    Hi All,

    i don't know anything about VBA, but I was able to locate a VBA script that works to fit my needs. The only thing that does not work is the "Cancel' button that populates on the Input boxes. Can someone help me fill in the gap for this?

    ----------
    Sub AZ_Monthly()
    
    Dim cvsApp As Object
    Dim cvsConn As Object
    Dim cvsSrv As Object
    Dim Rep As Object
    Dim Info As Object, Log As Object, b As Object
    Dim CMSRunning As String
    Dim objWMIcimv2 As Object
    Dim objProcess As Object
    Dim objList As Object
    
    CMSRunning = "acsSRV.exe"
    
    Set objWMIcimv2 = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\.\root\cimv2") 'Connect to CIMV2 Namespace
    
    Set objList = objWMIcimv2.ExecQuery _
    ("select * from win32_process where name='" & CMSRunning & "'") 'determine if CMS is running
    
    If objList.Count = 0 Then 'If 0 then process isn't running
    
    End If
    
    Set cvsApp = CreateObject("ACSUP.cvsApplication")
    Set cvsConn = CreateObject("ACSCN.cvsConnection")
    Set cvsSrv = CreateObject("ACSUPSRV.cvsServer")
    Set Rep = CreateObject("ACSREP.cvsReport")
    
    Application.ScreenUpdating = 0
    
    Set cvsSrv = cvsApp.Servers(1)
    Application.ScreenUpdating = 1
    
    AgGrp = InputBox("Enter Agent Group Name", "Agent Group", "Medicare BSU AZ") 'change as needed for variables to enter into report
    RpDate = InputBox("Enter Date", "Date", "XX/XX/XXXX-XX/XX/XXXX") 'change as needed for variables to enter into report
    
    'Start code from CMS Export script
    On Error Resume Next
    
    cvsSrv.Reports.ACD = 2
    Set Info = cvsSrv.Reports.Reports("Historical\Designer\Medicare BSU Metrics")
    
    b = cvsSrv.Reports.CreateReport(Info, Rep)
    If b Then
    
    Rep.Window.Top = 1830
    Rep.Window.Left = 975
    Rep.Window.Width = 17610
    Rep.Window.Height = 11910
    
    Rep.SetProperty "Agent Group", AgGrp 'change as needed for report variables
    
    Rep.SetProperty "Dates", RpDate 'change as needed for report variables
    Rep.TimeZone = "default"
    b = Rep.ExportData("", 9, 0, True, True, True)
    Rep.Quit
    
    If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
    Set Rep = Nothing
    End If
    
    Set Info = Nothing
    
    ' End code from CMS Export Script
    
    cvsConn.logout
    cvsConn.Disconnect
    cvsSrv.Connected = False
    Set Log = Nothing
    Set Rep = Nothing
    Set cvsSrv = Nothing
    Set cvsConn = Nothing
    Set cvsApp = Nothing
    Set Info = Nothing
    
        Range("Z53").Select
        ActiveSheet.Paste
        
        End Sub
    Last edited by jeffreybrown; 03-11-2019 at 05:53 PM. Reason: Please use code tags when posting code!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] conditional self canceling macro
    By gt4udish in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2015, 06:56 PM
  2. Canceling a Print Job
    By EdWoods in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-14-2013, 08:02 PM
  3. canceling sorting function
    By Vogelmann in forum Excel General
    Replies: 2
    Last Post: 10-24-2012, 07:49 AM
  4. BeforeClose Event - MsgBox Yes No - is not canceling
    By ker9 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-03-2012, 11:51 AM
  5. Loop in canceling of event
    By AnthonyWB in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-30-2011, 07:14 PM
  6. Canceling out zeros
    By esupply in forum Excel General
    Replies: 5
    Last Post: 03-12-2010, 05:07 PM
  7. Canceling items from a sheet
    By Skiman in forum Excel General
    Replies: 9
    Last Post: 03-02-2008, 09:12 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1