Sign in to follow this  
Followers 0
Patrickc

"could not use '|'; file already in use" when opening datalogging in excel

7 posts in this topic

I get the error: "could not use '|'; file already in use" when I refresh the table in excel. The only solution i found was to turn off data logging, refresh and then turn it on again, but the problem with this is that it creates another data point when you start the datalogging again, and that is a problem since I need a report (on excel ) that shows the daily consumption. So I only want one data point per day, because otherwise, it will mess up the calculations on excel. Any idea how i could access the data log file without having to stop data logging - or, if that isn't possible, how I could prevent data logging from creating a new data point when I re-start the data logging? Thank you very much Patrick

Share this post


Link to post
Share on other sites
Okay back up a bit and tell us what the heck you are talking about? (Software name, PLC type, anything else relevant)...

Share this post


Link to post
Share on other sites
Hehe ok sorry you're right, didn't realise i didnt give any details. So, I'm using Factory talk View 6.10 to do datalogging on some tags (which are already in FT view). This datalog is saved in OBDC format. I am using excel 07 to access this datalog file and draw a table with it, showing me Tag name, Date & Time, and Tag Value. Problem is, to refresh excel to get the new data, I need to stop the datalogging on Factory talk (otherwise I would get the error i mentioned above). Everytime I do this, I get a new datapoint created (i.e. a value for the tags for that current time). Now by time, things start getting messed up, the datalog points available are jumbled up and "seem" random - since there are multiple datapoints at times where a 'snapshot' of the tags should not have been taken. I would like to find a way to bypass this error to avoid having to stop the datalogging on factory talk to refresh excel (basically avoiding creating extra datapoints) Any idea? Thank you

Share this post


Link to post
Share on other sites
Don't know squat about FT View's datalog feature, but I've written my fair share of excel vba code. care to post a copy of the sheet so we can see what excel is doing. for those that do ft view they might use the ft view app also.

Share this post


Link to post
Share on other sites
I attached the file, you might need to change some settings around because i tried to make it look like a webpage when in fullscreen. Thank you Also if you're good at VBA; I am using this code: Private Sub Button1_Released() Excel.Application.Workbooks.Open "C:\Users\BMS\Desktop\Schedule with button.xlsm" Excel.Application.Visible = True End Sub To open an excel file. Now, the Excel file is supposed to be always open and constantly running, since its updating from it. Is there a way that I could change the code so that it will maximize it (if minimized) or open (if closed). I am running with a dual monitor setup and I need it to popup on the right hand side monitor (monitor 2) - if this makes any difference. I have no idea on how VBA works, never studied it, so I'm depending on help :) Thank you Patrick Schedule with button.rar Edited by Patrickc

Share this post


Link to post
Share on other sites
Ok so I opened and looked at your sheet -- now I have some observations and even more questions - sorry about that, but sometimes I'm thick headed. Observation 1 - Nice Layout and Screen to Screen feature. I assume the Sub_Button1_Released() code is in your FTView application macros or something? If the sheet is open and logging data then using the visible= True and visible = false functions should show or hide the workbook without needing to open it each time. In other words have the FTView Application Open and Visible=false the workbook and have the button change to visible = true and a button in the workbook for visible = false when oeprators are done. Hope this is making sense. Of course a lot depends on where and how you've hooked excel to ftview and I'm not seeing that part of the vba yet. other gurus can weigh in and prove me blind -- I welcome it :)

Share this post


Link to post
Share on other sites
Doesn't apply anymore - that was for my original question of "could not use '|'; file already in use". Now about the code: Sub_Button1_Released() is a button on FT view, the code I pasted below it was VBA code that was assigned to the button so as to open the excel sheet. I guess if i make 2 different buttons - one to make it visible and one to actually open it, the user would have both options just in case the excel sheet is closed (even though I'm sure i can protect it - but ill get to that later :) ) Another remark about the sheet attached: Delete the backround and unhide a couple of rows so you can have a look at the working :) It was a bitch to figure out and implement on excel since I'm not an expert in excel, or any other software! I just know how to use a lot of different software :) Also, if anyone would like to use the excel sheet attached, just ask for permission and I would be more than happy to let you :) Thank you, Patrick Edit: Hmm, I tried doing this: Private Sub Button3_Released() Excel.Application.Visible = True End Sub But apparently that didn't work - I'm quite sure I'm doing something wrong =/ Thanks Edited by Patrickc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0