Engineer123
New Member
- Joined
- Nov 21, 2019
- Messages
- 8
I have a large VBA project I'm working on that uses the "Right" function a lot. All of a sudden it gives me an error message of...
"Compile Error
Wrong number of arguments or invalid property assignments."
When I try to compile, with the "Right" Function highlighted. What's really strange is that it worked earlier and it worked in other files.
The following code...
Private Sub RightTester()
'This should trigger a message box with the letter "g'
MsgBox (Right("String", 1))
End Sub
… works perfectly in a blank file. And will work for a while if I copy all the code into a blank file and start from there. I thought that somehow a function library got changed in that file. But it doesn't work consistently in any file I work with for any amount of time. What's really strange is that "Left" works perfectly.
Does anyone have any idea what's going on?
"Compile Error
Wrong number of arguments or invalid property assignments."
When I try to compile, with the "Right" Function highlighted. What's really strange is that it worked earlier and it worked in other files.
The following code...
Private Sub RightTester()
'This should trigger a message box with the letter "g'
MsgBox (Right("String", 1))
End Sub
… works perfectly in a blank file. And will work for a while if I copy all the code into a blank file and start from there. I thought that somehow a function library got changed in that file. But it doesn't work consistently in any file I work with for any amount of time. What's really strange is that "Left" works perfectly.
Does anyone have any idea what's going on?