|
|
Rank: Guest Groups: Guest
Joined: 2/27/2008 Posts: 20 Points: -1,859
|
I am evaluating your software to use with a KepwareEx server package. I have successfully been able to view working OPC links. Is there a method to have your software start updating automatically when the file is first opened? When the computer re-boots it automatically runs an Excel file that has our OPC links within it. It would be nice if we didn't have to go in and start the updates again. Any help will be appreciated.
|
|
Rank: Member Groups: Administration
, Member
Joined: 2/28/2008 Posts: 20 Points: -37
|
Please copy the following macro to your workbook VBA ,
Dim isactivated As Boolean
Private Sub Worksheet_Activate()
If Not isactivated Then
isactivated = True
Application.Run "OPCEx3.xla!StartUpdate"
End If
End Sub
Please let me know if you need more information
|
|
Rank: Newbie Groups: Member
Joined: 7/31/2008 Posts: 1 Points: 3 Location: cologne
|
Hi, I tried your solution and I am facing some problems: 1) when I open my excel file the event worksheet_activate is not triggered automatically. When I trigger it by activating the worksheet via VBA I get the following message: 'Only One OPCEx WoorkBook is allowed at a time. You won't be able to use OPCEx features in this WorkBook. Please close the current OPCEx WoorkBook and reopen this document to use OPCEx features'
Do you have an idea what I can do to prevent this message or what am doing wrong ?
Thanx in advance
Markus
|
|
Rank: Administration Groups: Administration
Joined: 2/27/2008 Posts: 1 Points: -2,742
|
Please try to use the following macro.
Dim isactivated As Boolean Private Sub Workbook_Activate() If Not isactivated Then isactivated = True Application.Run "OPCEx3.xla!StartUpdate" End If End Sub
Make sure that you are not running any other OPCEx Excel worksheet.
|
|
|
Guest |