RSVIEW32 VBA help required please

LordNeil

Member
Join Date
Sep 2014
Location
Nottingham
Posts
4
Hi, I'm pretty new to the RSVIEW32 & have encounted a problem whilst coding visual basic.

The error is:-
Compile Error: Sub or Function not defined


The code is:-
Sub MouldConfirm()
If gTagDb.GetTag("Manual\MouldConfirm") = 1 And gTagDb.GetTag("Robot\In06") = 1 And gTagDb.GetTag("Robot\In00") = 0 And gTagDb.GetTag("Robot\In09") = 1 Then
ShowDisplay ("Robot")
Else: ShowDisplay ("Casting")
End If
End Sub


If you could help, that'd be brill.
Thanks all.
 
I guess I would start by eliminating some of the items in your sub and when you remove the offending item, you'll at least know what's causing it.

Can you simply have ShowDisplay("Robot") in your sub and have it still work?
 
Is there suppose to be a colon after Else?

Instead of Else: shouldn't it be just Else

I've seen where an error in the way an If/End If is structured the compiler doesn't recognize the End If as being the end of the If/End If block so it tries to use the End Sub to close the If/End IF block; now your Sub is missing its closing statement. So you get an error.
 
Last edited:
@danatomega - I tried reducing it to just the ShowDisplay, but the same error occurs.


@Valley Ind - The colon is put in automatically by the software. I tried removing it, but it put the colon back in.
 
It seems that the problem lays with the ShowDisplay command.
Is this the correct one, or is there another one I can use?
 
Last edited:

Similar Topics

Hello all, New to the forums here and glad to find this oasis of RSView/FactoryTalk info! I have a basic VB question I hope can be answered...
Replies
4
Views
2,308
Hey, I'm looking for a bit of guidance on some vba code in RSView32. For the record I know zero (I know its shameful) VBA code. What I'm trying...
Replies
7
Views
5,590
Good friends, I'm new to the forum, I'm working with RSview32, someone can help me how to make a macro in VBA, to save some data in Excel. to...
Replies
6
Views
1,954
We were given RSView32 project files, for quoting, that will be converted to FTView SE. Unfortunately the project has VBA references that were...
Replies
9
Views
4,319
Hi, I got a RSview32 project from site with VBA scripts and trying to run on my local machine to make some graphical changes. VB scripts are used...
Replies
6
Views
3,495
Back
Top Bottom