• caojunhe24 (11/12/2015)


    I have one script task at top of the package to check if there are any excel file exist in two different folders . If no file exist i will do normal process otherwise I will check if that excel file is opened or not.

    when I paste this code into my script task to check if it's opened or not the script task is running like forever -no result come out.

    the result what I want to is if excel file is open(we can create a variables to hold this value) then the next task will be send email using this variable(expression) otherwise go to next step. I'm planning to create another send email task after that but is that possible to do these steps in one script task?

    Why do you have this inside a while loop? The way you have this coded it will stay inside that loop until the file is closed. I always cringe when I see a loop that is basically while(True).

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/