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
Re: Run Time Error 5 (Invalid procedure column or argument
What line does the error occur on?
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
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.
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
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?
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 ??
Re: Run Time Error 5 (Invalid procedure column or argument
Quote:
Originally Posted by
Max187Boucher
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.