Rsview32 VBA problems

asterof

Member
Join Date
May 2007
Location
Califonia
Posts
554
Version 6.30.17 very old
Project has not used vba scripting prior to this problem
Took the 6.30.17 project and put it into a 7.20 version
running on Windows 2000 to develop changes on with the
understanding that the changes would be hand coded into
the 6.30.17 version. Used 7.20 just to prove out the scripts
and changes.
The OS for the 6.30.17 was upgraded to XP SPK2 sometime
in the past two years.

I am amazed that 6.30.17 even ran on XP

So the script work great on the 7.20 under Windows 2000

The script created inside the MS Form runs great on the 6.30.17.

But the calling script that loads the MS Form as simple as it is in the MyProject tree, will not run.

It does not fault, it just does not run.
So I am lost as to why
It would seem that if the script is run from in the display
environment, verses the MS Form environment fails to
function properly.
 
Are you absolutely sure that all of the VBA packages that you are referencing are available on the client?

Maybe check the event log on the computer to see if you can catch the error.
 
Not sure, but the code runs

"Are you absolutely sure that ......"

I would assume so, because of no faults
I will post both sets of code later today

the first code triggered by a form even acts differently
than the code running on the Windows 2000 machine
on ver 7.20 that the same code on the XP machine running ver 6.30.17
 
That isn't surprising.
Windows Common Controls Libraries vary significantly between versions of Windows. Even the same version can have completely different versions depending on loaded software.

I do not believe that you have no faults. Rather, I believe that you haven't located them, or have event logging disabled.

See here for just some of the shell library differences:
http://msdn.microsoft.com/en-us/library/bb776779(v=VS.85).aspx

In short, unless you can tell me absolutely that your project is correctly referencing the same libraries on both systems, there is no need to try to troubleshoot.

If VBA cannot load an object package, even if only referenced once and unused, the entire VBA engine shuts down. If you try to load the wrong package, or mix and match two, the VBA engine shuts down.

Load Studio onto the problem machine, and manually debug it there.

Step through line by line if you have to.
 
code listing

Here is the code that is not working on 6.30.17 running under
Windows XP, but does work fine under 7.20 Windows 2000.
This code resides under the ThisProject Folder in the
Vba Editor.

Public Sub Test()
Dim mTag As Tag
Set mTag = gTagDb.GetTag("Footage\password")
If Not (mTag Is Nothing) Then
If StrComp(mTag.Value, "alumafold") = 0 Then
mTag.Value = ""
Load cntForm
cntForm.Show
Else
MsgBox "Enter New Data"
End If
Set mTag = Nothing
End If
End Sub

Here is the code that works on both machines
As you can see it is far more complicated that the code
that does not function.
This code resides in a cntForm under the Forms Directory
in the tree

Option Explicit
Dim WithEvents value1 As Tag
Dim WithEvents value2 As Tag
Dim WithEvents value3 As Tag

Private Sub CommandButton7_Click()
cntForm.Hide
Unload cntForm
End Sub

Private Sub ResetBatch1_Click()
Dim aTag As Tag
Dim Value As Integer
Set aTag = gTagDb.GetTag("Footage\BMR") ' reset batch counter and transfer data
Value = aTag
Value = 1
aTag.Value = Value
Set aTag = Nothing
End Sub

Private Sub ResetBatchAuto_Click()
Dim aTag As Tag
Dim Value As Integer
Set aTag = gTagDb.GetTag("Footage\BRok")
Value = aTag
If (Value = 0) Then
Value = 1
ResetBatchAuto.BackColor = RGB(68, 170, 0)
aTag.Value = Value
Else
Value = 0
ResetBatchAuto.BackColor = RGB(238, 68, 85)
aTag.Value = Value
End If
Set aTag = Nothing
End Sub

Private Sub ResetBatchNoData_Click()
Dim aTag As Tag
Dim Value As Integer
Set aTag = gTagDb.GetTag("Footage\BZR") 'reset batch no data transfer
Value = aTag
Value = 1
aTag.Value = Value
Set aTag = Nothing
End Sub

Private Sub ResetTotal1_Click()
Dim aTag As Tag
Dim Value As Integer
Set aTag = gTagDb.GetTag("Footage\MTR") 'reset master total with transfer
Value = aTag
Value = 1
aTag.Value = Value
Set aTag = Nothing
End Sub

Private Sub ResetTotal2_Click()
Dim aTag As Tag
Dim Value As Integer
Set aTag = gTagDb.GetTag("Footage\MZR") 'reset master total with no transfer
Value = aTag
Value = 1
aTag.Value = Value
Set aTag = Nothing
End Sub

Private Sub Update_Button_Click()
StartMonitor
value1 = PPRbox.Text
value2 = Diabox.Text
value3 = GBRbox.Text
StopMonitor
End Sub

Private Sub UserForm_Initialize()
Dim aTag As Tag
Dim Value As Integer
Set aTag = gTagDb.GetTag("Footage\BRok")
Value = aTag
If (Value = 0) Then
ResetBatchAuto.BackColor = RGB(238, 68, 85)
Else
ResetBatchAuto.BackColor = RGB(68, 170, 0)
End If
Set aTag = Nothing
StartMonitor
PPRbox.Text = value1
Diabox.Text = value2
GBRbox.Text = value3
StopMonitor
End Sub

Sub StartMonitor()
On Error GoTo ErrHandler
Set value1 = gTagDb.GetTag("Footage\PPR")
Set value2 = gTagDb.GetTag("Footage\RDia")
Set value3 = gTagDb.GetTag("Footage\GBR")
Exit Sub
ErrHandler:
MsgBox "StartMonitor " & Err.Description, vbCritical
End Sub

Sub StopMonitor()
On Error Resume Next
Set value1 = Nothing
Set value2 = Nothing
Set value3 = Nothing
End Sub

Private Sub eMYTag_ValueChange(NewValue As Variant)
MsgBox "MyDeviceTag Value is Now " & Str(NewValue), vbOKOnly
End Sub
 

Similar Topics

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
Please somebody upload this manual on another site or forward me 51770 - Sample VBA: Exercise in migrating an RSView32 application with VBA to...
Replies
8
Views
4,913
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
Back
Top Bottom