Results 1 to 8 of 8

Thread: Run Time Error 5 (Invalid procedure column or argument

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Posts
    688

    Run Time Error 5 (Invalid procedure column or argument

    Hi

    When i move from 7 column to another column it gives this error

    Private Sub flxgd_EnterCell()
    With flxgd
    Select Case .Col
    Case 4
    msgtxt.Enabled = True
    msgtxt.Visible = True
    msgtxt.SetFocus
    msgtxt.Move flxgd.Left + flxgd.CellLeft, flxgd.Top + flxgd.CellTop, flxgd.CellWidth, flxgd.CellHeight
    msgtxt.Text = .Text
    Case 7 To (flxgd.Cols - 1)
    msgtxt.Enabled = True
    msgtxt.Visible = True
    msgtxt.SetFocus
    msgtxt.Move flxgd.Left + flxgd.CellLeft, flxgd.Top + flxgd.CellTop, flxgd.CellWidth, flxgd.CellHeight
    msgtxt.Text = .Text
    End Select
    End With
    End Sub

    Thanks

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: Run Time Error 5 (Invalid procedure column or argument

    What line does the error occur on?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Posts
    688

    Re: Run Time Error 5 (Invalid procedure column or argument

    Hi

    On this line
    msgtxt.Move flxgd.Left + flxgd.CellLeft, flxgd.Top + flxgd.CellTop, flxgd.CellWidth, flxgd.CellHeight

    Thanks

  4. #4
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: Run Time Error 5 (Invalid procedure column or argument

    Have you checked the values of the parameters on that line when the error occurs? I.E. while the program is stopped on that line hover your mouse over each parameter to see what its value is.

  5. #5
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: Run Time Error 5 (Invalid procedure column or argument

    I would have a look at the width and height the others can be 0 or less
    whats the error you are getting?
    try to hover over the parameters as datamiser said

  6. #6
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: Run Time Error 5 (Invalid procedure column or argument

    Well, I can't make it fail
    Code:
    Private Sub flxgd_EnterCell()
    With flxgd
        Select Case .Col
            Case 4, 7 To .Cols - 1
                msgtxt.Enabled = True
                msgtxt.Visible = True
                msgtxt.SetFocus
                msgtxt.Move .Left + .CellLeft, .Top + .CellTop, .CellWidth, .CellHeight
                msgtxt.Text = .Text
        End Select
    End With
    End Sub
    
    Private Sub Form_Load()
    Dim intI As Integer
    Dim intJ As Integer
    flxgd.Cols = 10
    flxgd.Rows = 5
    flxgd.FixedCols = 1
    flxgd.FixedRows = 1
    For intI = 0 To flxgd.Rows - 1
        For intJ = 0 To flxgd.Cols - 1
            flxgd.TextMatrix(intI, intJ) = intJ
        Next intJ
    Next intI
    End Sub
    Did you post the exact code or just the edited highlights?
    Last edited by Doogle; Sep 10th, 2012 at 06:15 AM.

  7. #7
    Addicted Member ryanframes's Avatar
    Join Date
    Apr 2012
    Posts
    210

    Re: Run Time Error 5 (Invalid procedure column or argument

    what are you trying to do ??
    do you want to move msgtxt to the selected column ??
    Sorry for bad english.

  8. #8
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: Run Time Error 5 (Invalid procedure column or argument

    Quote Originally Posted by Max187Boucher View Post
    whats the error you are getting?
    Looking at the Thread Title I'm guessing it's an 'Invalid Procedure Call or Argument' and the only way I can see of getting one of those, on the line OP says is failing, is if the Width and / or Height are less than zero; bearing in mind that the FlexGrid CellWidth and CellHeight are read only properties, I'm struggling to understand.

Posting Permissions

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



Click Here to Expand Forum to Full Width