Opening of Data log Excel file during RS view project running.

Reading between the lines, someone else hired these yahoos for political reasons and now you can't get rid of them and hire some operators that know how to do the job.
 
I do not know if this will work for you but it could be worth a try

Create a new Graphics screen, then go to Objects, and select ActiveX Control, then drag a box on the Graphics screen, and select an option probably Microsoft Office Spreadsheet.

Hi Gil47

No. This only opens a MS Excel sheet and we can not go to the "File" to select the desired one.
 
Try this method that I use:

Open the VB editor.
Go to Tools>References, select Microsoft Excel Object Library and press OK.
Then write a code to open an Excel file similar to this:

Code:
Public Sub Excel_Call()

Excel.Application.Workbooks.Open "Write the path to your file here"
Excel.Application.Visible = True

End Sub

Now Just create a Button in your display and in it's action set up running of that code using VbaExec
 
The target file is not a read only.
IF RSView has a DLGLOG Data Log CSV-type file OPEN, then it will be read-only for the OPEN period. Unfortunately I don't think the newer Excel version have an option to open a file as read-only. The newer Excel tries to ask you "File is in use. Do you want to open a read-only copy?" That only works where you have a Window where the dialog box can appear. You seem to have closed off that possibilty to prevent operators from "plyaing". It also prevents you from playing around with this!

If an Excel file is being written to by another application (RSView for example), then you cannot open it at that time (except as a read-only copy). Post #3 is still valid:
Is this Data Log Excel file one that is already being used by RSView32 to collect data? If so, then the file will already BE open, so Excel will refuse to OPEN it again, even if you command it to do so with AppStart.

Two work-arounds: (1)Close the RSView CSV data file first, before trying to open it with Excel. or (2) In RSview, save a second copy of the CSV data file, then close it, leaving first copy open if needed. Now use Excel to open the closed second file copy.
 
Last edited:
Hi Anirban Hazra

I think if we write the code in VB to open just MS Excel and then select the desired file then (for me) it will work. I tried to write the code but it did not work and error appeared.

Public Sub Excel_Call()
Excel.Application.Workbooks.Open "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE"
Excel.Application.Visible = True
End Sub

untitled.PNG
 
Last edited:
That code is for opening a file with Excel and you are trying to open the Excel application itself with it.That is why the error is coming.
 
Forget VB, you are opening a can of whipass worms on yourself. EDIT: NEvermind, now that I read above, the code looks familiar, probably the code I vaguely remember

You have it working but you have to take other steps to bring it to foreground.

The workarounds differ between OS. I can't remember what the steps were, but it is a simple script in the command line if I remember correctly, like a two line batch file that you call from the RSView32 AppStart function, and it starts and comes to the foreground. You can add a couple more lines to limit how many instances of an application can be opened.

I once got 42 instances of Calc running at once behind a locked Vew32 app on a plycutter machine.

EDIT: I think you are trying to open a file that is not in csv format, rather your dat log is set up for the RSView32 log file format (terms may be off).
 
Last edited:
Lots of interesting approaches. But unless I read this wrong, you were able to get Excel to open, but it was minimized. You wanted it to pop up over the existing window.

If that is the case, then you need to change a Windows setting called ForegroundLockTimeout. This setting prevents applications from stealing the "focus" from the current application that has the focus.

Google that term and you can read about the setting. You will see too that if you waited long enough without touching anything on the PC then Excel would actually pop up.

To "fix" this, you need to edit the registry.

HKCU\Control Panel\Desktop is the section and ForegroundLockTimeout is the specific key. Change it to zero and applications triggered by Appstart will pop up immediately.

Rockwell has a tool for this as well. See the following Tech Note (requires Tech Connect contract)

29658 - ForegroundLockTimeout Causes Applications to Display Behind RSView
https://rockwellautomation.custhelp.com/app/answers/detail/a_id/29658

Of course you will still have issues with Read-Only if the datalog is writing to this file, but you can open a static read-only version of the file.

OG
 

Similar Topics

I have an Allen Bradley temperature switch that I am trying to use in studio 5000. I am getting the message "Unable to interpret the IODD file"...
Replies
0
Views
85
Very similar issue as the last post I had here with communicating our Linux Gateway to an AB CompactLogix controller. I have assigned a gateway...
Replies
7
Views
186
Hi All, I am trying to program some new Versamax micro PLCs through PAC using some programs saved in our archive however whenever i go to import...
Replies
2
Views
130
Hello, I have a CNG compressor that is run by a PLC. I tried to get team viewer on it to be able to view it remotely, I accidently disabled the...
Replies
0
Views
113
Hi All, I've been pulling my hair out trying to fix this for a few days and need some advice. I have V19.01, v20.05, V21, V24, V30, V31, V32...
Replies
5
Views
431
Back
Top Bottom