Now I have a solution for my problem.
I use the function
to save my log files. When I use the
functions then the current directory is changed to the installation path of office package. As I work on a Windows 7 machine I have no access to the folder programm files where the office package is installed. This means that I have no rights to save my log files and I get an exception.
As a result I save the path to the current directory when the program starts and so I have no problems anymore.