Checked out the link bellow and tried to use the method proposed there with no results. My problem relates with importing from an Excel file using the OLEDB provider, for some reasons that I don’t understand, when the file is open in Excel the import shows some columns (e.g date) as text, it doesn’t happen when the file is not in use. My problem can be solved temporally by checking if the xls file is open/in use, so I can post a message asking the user to close the file.
Thanks,
Mihail
One way to do that would be opening the file in exclusive mode. This will fail if the file is open in any other process, and it will also prevent other processes from opening it until you close the handle. For example: