Excel logging problem.


Recommended Posts


I have had configured the DAQFactory to logs into an excel file such as the help topics said.

In short periods, it works fine, but when I let he PC logging a few days, I can not read the file because windows says that it is in use but the programm (DAQF) is closed.

These are the steps I follow:

- When I want to download/read the file, I end the logging process.

- Wait for some time so the program has time to close the file properly

- Close DaqF

- Give it more time

- Try to open the file but it is in use.

There is a process called daqfactory.exe after i closed the program. If i stop the process, I can access the xls file but there is no data.

This has happen three times.

So, Is there any way to recover the file without losing data logs?


Link to comment
Share on other sites

Actually, the easiest way to get DAQFactory to release the file is to simply change the file name that the logging set is using. This will cause the logging set to close the current file and start on a new one. You still have to wait a second or two for this to happen. You can make the change in the development environment, or in script.

Link to comment
Share on other sites

Thank you for your help but we had already try that. I used

Logging.MyLogging.strFileName = "MyData_" + FormatDateTime("%y_%m_%d.csv",SysTime())

in the events of one of the channels but it changes the name of the Data source of the ODBC and not the name of the excel file.

Could you tell me whats the way to change the name of the excel?

Thanks for your time

Link to comment
Share on other sites

Oh, you are using ODBC through the Excel ODBC driver. I thought you were writing to a CSV file and then loading it into Excel.

You can't change the name of the actual file if you are using ODBC. That is set from the ODBC configuration.

My guess is that the ODBC is actually locking up the file. Also, some configuration is off if the file is blank.

My recommendation is to log to a CSV file, use the logging file name rename to release the file and load it into Excel that way. A file with a .csv extension will load directly into Excel with no prompting.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.