Results 1 to 8 of 8

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

  1. #1
    Addicted Member
    Join Date
    Dec 11
    Posts
    243

    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 12
    Location
    West Virginia
    Posts
    4,957

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

    What line does the error occur on?

  3. #3
    Addicted Member
    Join Date
    Dec 11
    Posts
    243

    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 12
    Location
    West Virginia
    Posts
    4,957

    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
    Frenzied Member
    Join Date
    Aug 11
    Location
    B.C., Canada
    Posts
    1,838

    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 06
    Location
    Maldon, Essex. UK
    Posts
    5,150

    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
    Lively Member ryanframes's Avatar
    Join Date
    Apr 12
    Posts
    116

    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 ??
    every problem in this world 99.9 % can be solved by ur own self,, it's only about the time and about how effective u are when u solving u'r problem..


  8. #8
    PowerPoster
    Join Date
    Jul 06
    Location
    Maldon, Essex. UK
    Posts
    5,150

    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
  •