Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to check Excel file open/closed in sql?

Author  Topic 

rpan
Starting Member

1 Post

Posted - 2004-06-07 : 14:56:47
I am using sp_OACreate to create an Excel application and exporting data from sql database to Excel sheets. My question is how to check if the Excel file is open or closed in T-sql before exporting data? Thanks in advanced.

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2004-06-08 : 07:55:22
Try to rename it to itself.....if the rename works it exists and is closed....if the rename fails....either it doesn't exist...or it's open.
Go to Top of Page
   

- Advertisement -