?
Solved

Occasional Overflow error while calling a function (VB)

Posted on 2011-05-12
11
Medium Priority
?
464 Views
Last Modified: 2013-12-25
Hie there,

I am managing a MIS system that is written mainly in VB. I noticed from the error log that every now and then there is a Overflow error occurrence when the system was calling a public function.  The function is to clean/initialize the controls on the form, and it is well established and being used numerously.

I have gone through the code of the function a few times and couldn't find any obvious assignment statements that might assign an exceeding value to the data type. Could anybody out there give me some clues regarding the matter?

Thanks in advance!

Yvonnez
0
Comment
Question by:IYZ
  • 5
  • 5
11 Comments
 
LVL 16

Expert Comment

by:HooKooDooKu
ID: 35750101
Can you provide any details on the public function you think the overflow is occur in?

Unfortunately, the Overflow error is a pretty generic error anytime a variable is assigned a value that might be too big for it.

Of course there are the obvious ones, like when someone tries to set a Byte to 1000, or an Interger to 100000.

There is also one "hidden" type of overflow that isn't always obvious... temporary variable overflows.  If you are doing math with integers and placing the result in a long, all of the math will get done with integers and nothing gets converted to a long until the assignment.  So as an example, the follow code would generate one of these "hidden" overflows:

Dim I1 as Integer
Dim I2 as Integer
Dim L1 as Long

I1 = 1000
I2 = 2000
L1 = I1 * I2   'OVERFLOW

The math operation of 1000 * 2000 will be done in a temporary Integer because none of the operators use a larger data type.  Sure the result of 2,000,000 will fit in a Long just fine, but not in the "hidden-temp" Integer variable VB will place the results in before they get copied to L1.
0
 

Author Comment

by:IYZ
ID: 35750537
Hi HooKooDooKu,

Thanks for your prompt response! Yes, I can attach the code of the function here. Basically, it cleans, or re-sets all the values of the properties of the controls that will be used later. The Sub is called ClearMe().

Please keep in mind that the frequency of  error occurs is about once or twice a week to once a month (per user),  among the numerous usage everyday.

Again, many thanks for your help!
Private Sub ClearMe()

Dim plMouse As Long
Dim pCtl As Control

    plMouse = Screen.MousePointer
    Screen.MousePointer = vbHourglass

    mbDont = True
    For Each pCtl In Me.Controls
        If TypeOf pCtl Is Label Or TypeOf pCtl Is Frame Or TypeOf pCtl Is CommandButton Or TypeOf pCtl Is Calendar Or TypeOf pCtl Is TabStrip Or TypeOf pCtl Is ActiveBar Or TypeOf pCtl Is PictureBox Then
            'this is just to shortcut the system
            ' so that it doesn't go through all of the items
        ElseIf TypeOf pCtl Is TextBox Or TypeOf pCtl Is fpText Or _
            TypeOf pCtl Is fpMemo Or TypeOf pCtl Is fpCurrency Then
            pCtl.Text = ""
            pCtl.Tag = ""
        ElseIf TypeOf pCtl Is fpMask Then
            pCtl.Text = ""
            pCtl.Tag = ""
        ElseIf TypeOf pCtl Is ComboBox Then
            pCtl.ListIndex = -1
        ElseIf TypeOf pCtl Is CheckBox Then
            pCtl.Value = vbUnchecked
        ElseIf TypeOf pCtl Is FileView Then
            pCtl.Visible = False
            pCtl.CurrentFolder = ""
        ElseIf TypeOf pCtl Is OptionButton Then
            pCtl.Value = False
        ElseIf TypeOf pCtl Is MSComctlLib.ListView Then
            pCtl.ListItems.Clear
        ElseIf TypeOf pCtl Is vaSpread Then
            If pCtl.Name = "ssPlayers" Then
                ssPlayers.Row = -1
                ssPlayers.Col = -1
                ssPlayers.Action = SS_ACTION_CLEAR_TEXT

                'and put back the douglas
                With ssPlayers
                    .Row = row_InHouse
                    .Col = col_RepName
                    .CellType = SS_CELL_TYPE_STATIC_TEXT
                    .Text = "In House"
                    .Col = col_Contacts
                    .CellType = SS_CELL_TYPE_STATIC_TEXT
                    .BackColor = vbGrey
                    .Text = ""
                    .Col = col_RepStatus
                    .CellType = SS_CELL_TYPE_STATIC_TEXT
                    .BackColor = vbGrey
                    .Text = ""
                    .Col = col_Comm
                    .Formula = ""
                    .Col = col_OU2
                    .Formula = "100 - SUM(#" & row_Rep1 & ":#" & row_Rep6 & ")"
                    .Col = col_OU1
                    .Formula = "100 - SUM(#" & row_Rep1 & ":#" & row_Rep6 & ")"
                    .Col = col_Buffer
                    .Formula = "100 - SUM(" & Chr((Asc("A") - 1) + col_Buffer) & row_Rep1 & ":" & Chr((Asc("A") - 1) + col_Buffer) & row_Rep6 & ")"

                    .Row = row_Totals
                    .RowHidden = True

                    .Col = col_Comm
                    .Formula = "SUM(#" & row_Rep1 & ":#" & row_Rep6 & ")"
                    .Col = col_OU2
                    .Formula = "SUM(" & Chr((Asc("A") - 1) + col_OU2) & row_Rep1 & ":" & Chr((Asc("A") - 1) + col_OU2) & row_Rep6 & ")"
                    .Col = col_OU1
                    .Formula = "SUM(" & Chr((Asc("A") - 1) + col_OU1) & row_Rep1 & ":" & Chr((Asc("A") - 1) + col_OU1) & row_Rep6 & ")"
                    .Col = col_Buffer
                    .Formula = "SUM(" & Chr((Asc("A") - 1) + col_Buffer) & row_Rep1 & ":" & Chr((Asc("A") - 1) + col_Buffer) & row_Rep6 & ")"
                End With
                
            ElseIf pCtl.Name = "ssSiteMisc" Then
                ssSiteMisc.Row = -1
                ssSiteMisc.Col = -1
                ssSiteMisc.Action = SS_ACTION_CLEAR_TEXT
                ssSiteMisc.MaxRows = 1
                
            ElseIf pCtl.Name = "ssCompInvoice" Then
                ssCompInvoice.Row = -1
                ssCompInvoice.Col = -1
                ssCompInvoice.Action = SS_ACTION_CLEAR_TEXT
                
'            ElseIf pCtl.Name = "ssMail" Then
'                ssMail.Row = -1
'                ssMail.Col = -1
'                ssMail.Action = SS_ACTION_CLEAR_TEXT
'                ssMail.MaxRows = mail_row_Header
            End If
        End If
        Select Case pCtl.Name
            Case "picDirSplitter", "picDocSplitter": 'do nothing, preserve the tag value.
            Case Else: pCtl.Tag = ""
        End Select
    Next

    'remove a couple of controls that don't fall into the above
    pctSOArrow(JBid1).Visible = False
    pctSOArrow(JBid2).Visible = False
    pctSOArrow(JBid3).Visible = False

    'hide all of the frames
    picFrameBid(QBid1).Visible = False
    picFrameBid(QBid2).Visible = False
    picFrameBid(QBid3).Visible = False
    picFrameBid(QBid4).Visible = False
    picFrameBid(SOSummary).Visible = False
    picFrameBid(JBid1).Visible = False
    picFrameBid(JBid2).Visible = False
    picFrameBid(JBid3).Visible = False

    'reset the framed bids
    FramedQBid = -1
    FramedJBid = -1
    'reset the max values for players
    msngTempComm = gApp.QJ.CommMax
    msngTempOU = gApp.QJ.OUMax
    msngTempBuffer = gApp.QJ.BufferMax
    'lock all the fields
    LockDown eOn
    'unload the bomeditor if it is still avail
    If Not frmBOMEditor Is Nothing Then
        Unload frmBOMEditor
        Set frmBOMEditor = Nothing
    End If

    'turn off the dont do it flag
    mbDont = False
    'set all changes = false
    mbHeaderChanged = False
    mbNotesChanged = False
    mbQBidsChanged = False
    mbPlayersChanged = False
    mbOrderChanged = False
    mbJBidsChanged = False
    mbSiteInfoChanged = False
    mbProductionInfoChanged = False
    mbMainSaveEnabled = False
    mbCompBidChanged = False
    'reset the bid pointers
    mlCurrentQBidId = -1
    mlCurrentJBidId = -1
    'reset the global variables if necessary

    If Not QJHead Is Nothing Then
        'Clear the lock.
        If Not QJHead.ReadOnly Then gApp.RecordLock.ClearLock QJHead.Key
        dlcMailGrid.ClearMe
        'Destroy the local reference.
        Set QJHead = Nothing
        'Remove the reference to the object from the dll.
        gApp.RemoveOLDQJHeads
    End If
    
    'adjust the toolbars
    If Not mbDontAdjust Then
        mbDontAdjust = True
        AdjustTools
        mbDontAdjust = False
    End If
    
    'Clear only these specific comboboxes
    cmbEngContacts.Clear
    cmbContContacts.Clear
    cmbBOContacts.Clear
    cmbWholesContacts.Clear
    
    'A few specific things
    lblQDirNotFound.Visible = False
    lblJDirNotFound.Visible = False
    txtTerritory.BackColor = txtProjectInfo(cName).BackColor
    txtTerritoryType.BackColor = txtProjectInfo(cName).BackColor
    
    mbProjectNotesLoaded = False
    mbCompNotesLoaded = False

    Screen.MousePointer = plMouse
    
End Sub

Open in new window

0
 
LVL 16

Expert Comment

by:HooKooDooKu
ID: 35756623
I've got Two suggestions.  

The first is to attempt to determine where the error is occuring so that you can fix the code.  On way to do that is insert line numbers in the function and add an error handler that can display the line number that generated the error.  The code below will do just that.  When the error occurs, the logic will jump to the CatchError and display the error.  The code I've enclosed, then resumes execution with the line number that follows the line that cause the error, and the program will continue to execute from there.  Of course what ever was supposed to get cleared by the line that threw the error will not be properly cleared.  So rather than 'Resume Next' to keep on executing, you could instead terminate the program with an End statement, or even better, re-raise the error so that the program will "crash" like it does not (Replace Resume Next with 'Call Err.Raise( Err.Number, Err.Source, Err.Description)' )

The second option would be to simply ignore the error.  Rather than "On Error Goto CatchError", use "On Error Resume Next".  This will cause the error to be ignored and the program contiune to execute similar to the Resume Next described above (except you get no message box and therefore no knowledge the error ever happened).  Now normally, 'On Error Resume Next' is considered bad code.  Especially since you won't know what line of code failed to execute.  I only suggest it here since the failure looks to possibly be minor since the purpose of the functon is to clear the control.  If you can live with the fact that one of the clear commands have failed, then On Error Resume Next will let the program contiue to execute without crashing (unless something later REQUIRES everything to be cleared... that's the danger of On Error Resume Next, the unexpected concequences).

.  The additional benefit her is that by the simple addition of an error handler, we can keep the program from crashing and at least TRYE

The second suggestion is one that is normally considered "BAD", but might be justified in this type of situation.  

Private Sub ClearMe()
Dim plMouse As Long
Dim pCtl As Control

    On Error Goto CatchError
0100:
0110:    plMouse = Screen.MousePointer
0120:    Screen.MousePointer = vbHourglass
0130:
0140:    mbDont = True
0150:    For Each pCtl In Me.Controls
0160:        If TypeOf pCtl Is Label Or TypeOf pCtl Is Frame Or TypeOf pCtl Is CommandButton Or TypeOf pCtl Is Calendar Or TypeOf pCtl Is TabStrip Or TypeOf pCtl Is ActiveBar Or TypeOf pCtl Is PictureBox Then
0170:            'this is just to shortcut the system
0180:            ' so that it doesn't go through all of the items
0190:        ElseIf TypeOf pCtl Is TextBox Or TypeOf pCtl Is fpText Or _
0200:            TypeOf pCtl Is fpMemo Or TypeOf pCtl Is fpCurrency Then
0210:            pCtl.Text = ""
0220:            pCtl.Tag = ""
0230:        ElseIf TypeOf pCtl Is fpMask Then
0240:            pCtl.Text = ""
0250:            pCtl.Tag = ""
0260:        ElseIf TypeOf pCtl Is ComboBox Then
0270:            pCtl.ListIndex = -1
0280:        ElseIf TypeOf pCtl Is CheckBox Then
0290:            pCtl.Value = vbUnchecked
0300:        ElseIf TypeOf pCtl Is FileView Then
0310:            pCtl.Visible = False
0320:            pCtl.CurrentFolder = ""
0330:        ElseIf TypeOf pCtl Is OptionButton Then
0340:            pCtl.Value = False
0350:        ElseIf TypeOf pCtl Is MSComctlLib.ListView Then
0360:            pCtl.ListItems.Clear
0370:        ElseIf TypeOf pCtl Is vaSpread Then
0380:            If pCtl.Name = "ssPlayers" Then
0390:                ssPlayers.Row = -1
0400:                ssPlayers.Col = -1
0410:                ssPlayers.Action = SS_ACTION_CLEAR_TEXT
0420:
0430:                'and put back the douglas
0440:                With ssPlayers
0450:                    .Row = row_InHouse
0460:                    .Col = col_RepName
0470:                    .CellType = SS_CELL_TYPE_STATIC_TEXT
0480:                    .Text = "In House"
0490:                    .Col = col_Contacts
0500:                    .CellType = SS_CELL_TYPE_STATIC_TEXT
0510:                    .BackColor = vbGrey
0520:                    .Text = ""
0530:                    .Col = col_RepStatus
0540:                    .CellType = SS_CELL_TYPE_STATIC_TEXT
0550:                    .BackColor = vbGrey
0560:                    .Text = ""
0570:                    .Col = col_Comm
0580:                    .Formula = ""
0590:                    .Col = col_OU2
0600:                    .Formula = "100 - SUM(#" & row_Rep1 & ":#" & row_Rep6 & ")"
0610:                    .Col = col_OU1
0620:                    .Formula = "100 - SUM(#" & row_Rep1 & ":#" & row_Rep6 & ")"
0630:                    .Col = col_Buffer
0640:                    .Formula = "100 - SUM(" & Chr((Asc("A") - 1) + col_Buffer) & row_Rep1 & ":" & Chr((Asc("A") - 1) + col_Buffer) & row_Rep6 & ")"
0650:
0660:                    .Row = row_Totals
0670:                    .RowHidden = True
0680:
0690:                    .Col = col_Comm
0700:                    .Formula = "SUM(#" & row_Rep1 & ":#" & row_Rep6 & ")"
0710:                    .Col = col_OU2
0720:                    .Formula = "SUM(" & Chr((Asc("A") - 1) + col_OU2) & row_Rep1 & ":" & Chr((Asc("A") - 1) + col_OU2) & row_Rep6 & ")"
0730:                    .Col = col_OU1
0740:                    .Formula = "SUM(" & Chr((Asc("A") - 1) + col_OU1) & row_Rep1 & ":" & Chr((Asc("A") - 1) + col_OU1) & row_Rep6 & ")"
0750:                    .Col = col_Buffer
0760:                    .Formula = "SUM(" & Chr((Asc("A") - 1) + col_Buffer) & row_Rep1 & ":" & Chr((Asc("A") - 1) + col_Buffer) & row_Rep6 & ")"
0770:                End With
0780:                
0790:            ElseIf pCtl.Name = "ssSiteMisc" Then
0800:                ssSiteMisc.Row = -1
0810:                ssSiteMisc.Col = -1
0820:                ssSiteMisc.Action = SS_ACTION_CLEAR_TEXT
0830:                ssSiteMisc.MaxRows = 1
0840:                
0850:            ElseIf pCtl.Name = "ssCompInvoice" Then
0860:                ssCompInvoice.Row = -1
0870:                ssCompInvoice.Col = -1
0880:                ssCompInvoice.Action = SS_ACTION_CLEAR_TEXT
0890:                
0900:'            ElseIf pCtl.Name = "ssMail" Then
0910:'                ssMail.Row = -1
0920:'                ssMail.Col = -1
0930:'                ssMail.Action = SS_ACTION_CLEAR_TEXT
0940:'                ssMail.MaxRows = mail_row_Header
0950:            End If
0960:        End If
0970:        Select Case pCtl.Name
0980:            Case "picDirSplitter", "picDocSplitter": 'do nothing, preserve the tag value.
0990:            Case Else: pCtl.Tag = ""
1000:        End Select
1010:    Next
1020:
1030:    'remove a couple of controls that don't fall into the above
1040:    pctSOArrow(JBid1).Visible = False
1050:    pctSOArrow(JBid2).Visible = False
1060:    pctSOArrow(JBid3).Visible = False
1070:
1080:    'hide all of the frames
1090:    picFrameBid(QBid1).Visible = False
1100:    picFrameBid(QBid2).Visible = False
1110:    picFrameBid(QBid3).Visible = False
1120:    picFrameBid(QBid4).Visible = False
1130:    picFrameBid(SOSummary).Visible = False
1140:    picFrameBid(JBid1).Visible = False
1150:    picFrameBid(JBid2).Visible = False
1160:    picFrameBid(JBid3).Visible = False
1170:
1180:    'reset the framed bids
1190:    FramedQBid = -1
1200:    FramedJBid = -1
1210:    'reset the max values for players
1220:    msngTempComm = gApp.QJ.CommMax
1230:    msngTempOU = gApp.QJ.OUMax
1240:    msngTempBuffer = gApp.QJ.BufferMax
1250:    'lock all the fields
1260:    LockDown eOn
1270:    'unload the bomeditor if it is still avail
1280:    If Not frmBOMEditor Is Nothing Then
1290:        Unload frmBOMEditor
1300:        Set frmBOMEditor = Nothing
1310:    End If
1320:
1330:    'turn off the dont do it flag
1340:    mbDont = False
1350:    'set all changes = false
1360:    mbHeaderChanged = False
1370:    mbNotesChanged = False
1380:    mbQBidsChanged = False
1390:    mbPlayersChanged = False
1400:    mbOrderChanged = False
1410:    mbJBidsChanged = False
1420:    mbSiteInfoChanged = False
1430:    mbProductionInfoChanged = False
1440:    mbMainSaveEnabled = False
1450:    mbCompBidChanged = False
1460:    'reset the bid pointers
1470:    mlCurrentQBidId = -1
1480:    mlCurrentJBidId = -1
1490:    'reset the global variables if necessary
1500:
1510:    If Not QJHead Is Nothing Then
1520:        'Clear the lock.
1530:        If Not QJHead.ReadOnly Then gApp.RecordLock.ClearLock QJHead.Key
1540:        dlcMailGrid.ClearMe
1550:        'Destroy the local reference.
1560:        Set QJHead = Nothing
1570:        'Remove the reference to the object from the dll.
1580:        gApp.RemoveOLDQJHeads
1590:    End If
1600:    
1610:    'adjust the toolbars
1620:    If Not mbDontAdjust Then
1630:        mbDontAdjust = True
1640:        AdjustTools
1650:        mbDontAdjust = False
1660:    End If
1670:    
1680:    'Clear only these specific comboboxes
1690:    cmbEngContacts.Clear
1700:    cmbContContacts.Clear
1710:    cmbBOContacts.Clear
1720:    cmbWholesContacts.Clear
1730:    
1740:    'A few specific things
1750:    lblQDirNotFound.Visible = False
1760:    lblJDirNotFound.Visible = False
1770:    txtTerritory.BackColor = txtProjectInfo(cName).BackColor
1780:    txtTerritoryType.BackColor = txtProjectInfo(cName).BackColor
1790:    
1800:    mbProjectNotesLoaded = False
1810:    mbCompNotesLoaded = False
1820:
1830:    Screen.MousePointer = plMouse
1840:
1850:    Exit Sub
CatchError:
        MsgBox Err.Description & vbcr & "Error @ Line:" & Erl
        Resume Next
End Sub

Open in new window

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 16

Expert Comment

by:HooKooDooKu
ID: 35756627
Ignore the last two pharagraphs above (hit submit before proofread... wish there was an edit function here).
0
 
LVL 10

Expert Comment

by:GlobaLevel
ID: 35756650
memory leaking? are you destroying your objects when done?
0
 

Author Comment

by:IYZ
ID: 35757916
Hi HooKoodooKu,

Thanks for your suggestions! We do have error handling mechanism in place and the error hander module inserts line numbers to the code. So, when opening a pre-compilation code we can see the line numbers, and that is how the error log can log-down what has been happened. The thing is, the error log shows the line number that was calling the ClearMe function (shown below). I have done a test in which I inserted a 'division by 0' statement into ClearMe(), and gave the line a line number. It appears the same in the error log, in which it shows the line number that called the ClearMe function but not the line number that is having error in the function.

In Error Log:
               ...
               8 : Call                  frmMain.frm : Sub OpenQJ : (QJKey=QJID45183, SOKey=)
               9 : Trap                  Runtime error 6, Overflow on line 30080
               10 :Call                  frmMain.frm : Sub ClearMe : ()
               11 :Error                  Runtime error 6, Overflow
               ...
In Code:
Public Sub OpenQJ(ByVal QJKey As String, Optional SOKey As String = "")
   ...
30080             ClearMe
 ...
End sub

Any thoughts on these will be appreciated!


   
0
 

Author Comment

by:IYZ
ID: 35757984
Hi GlobaLevel,

Thanks for your response! To answer your question, we do have payed attention to the Memory Leaking issue by destroying the objects in the end of their life cycle, as well as by terminating the form objects properly.
   
0
 
LVL 16

Expert Comment

by:HooKooDooKu
ID: 35815939
Ok, so you know from your existing error handling that ClearMe is causing the error.  But you don't have any error handling within ClearMe to determine which line within ClearMe is causing the error.  So you need to add the error handling within ClearMe so that we can determine which line within ClearMe is generating the error.  Otherwise, we don't know if the problem is within ClearMe, or if there is some odd VB bug that is causing an error just trying to call the subroutine.  

One minor change you can make (which shouldn't make a difference) is to change "ClearMe" to "Call ClearMe".  I know that that shouldn't make a difference, but ONCE (in my years of coding VB) I had a situation where having the keyword "Call" in front of a subroutine did indeed have an effect on how the subroutine executed (in my case a variable getting passed by reference... wasn't).  
0
 

Author Comment

by:IYZ
ID: 35825434
Hi HookooDooKu,

Thanks for your response again! Acutely the ClearMe() routine does have an error handler but it just that I didn't include it when posting the code to you. The application is using a third-party error handler application to instrument the error handler to each procedure if there is no existing one. And, each error handler leaves its foot-print on the error log if it's trigged.

The instrumentation (meaning the code of the error handlers) is done before the compilation. That's why it was not included in the code I posted. What puzzles me is that apparently the process does not get into the ClearMe sub because there is not trace of the error handler in ClearMe.

Any idea?

Many thanks!
 
0
 
LVL 16

Accepted Solution

by:
HooKooDooKu earned 2000 total points
ID: 35829151
From what you had already described, I'm not suprised that you would currently think the call to ClearMe is causing an error, but no code inside ClearMe is executing.

First of all, I have EXTENSIVE experience with VB and it's error handling.  I have zero experience with a third-party error-handing add-on.

I do know that VB on its own can do some... ODD things.  Like I've already discribed, the inclusion/exclusion of the word 'Call' before a subroutine has made the difference between a subroutine that worked correctly and didn't work correctly.  Another strange example is that I've had a situation where the addition of one more subroutine caused an application to quit compiling.  The solution, as goofy as it sounds, was to simply re-order subroutines withing the application and everything started working fine.

So if this is a relatively large application, I could see anything as possible.

The only suggestions I have is to add error handling inside of ClearMe and have it pop up a message box reporting the ERL that caused the error.  This assumes the 3rd party add-on will work with error handling you add in.  If not, you might need to try to remove the 3rd party add-on if you can.

If you can not add additional error handling that can superseed the 3rd party add-on, or if you can not remove the 3rd party add-on, then you might have to just live with this error.
0
 

Author Comment

by:IYZ
ID: 35833697
Hi HookooDooKu,

Thanks for the suggestion!  Yes, it is relatively large application. I do like the idea of adding error handling inside of ClearMe and writing the error description to a log file. The 3rd-party add-on will not interrupt with the sub if there is existed error handler. So, it's doable.  I am very interested to see what comes out from that log file.  

Again, thank you very much for your help, much appreciated!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month14 days, 12 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question