AnsweredAssumed Answered

Check if excel file is open

Question asked by Jonny Levelius on May 14, 2015
Latest reply on May 14, 2015 by Deepak Gupta

I am writing a macro that when the button is clicked it sends the custom properties of the particular part or assembly to an excel file and lists the properties horizontally.  It then grabs a new part number associated with that row and copies it the clipboard to be pasted into the SaveAs file dialog box.  Then it saves and closes the excel file.  I have it set up where the excel file doesn't even show up.  I need the macro to first check if the master part excel file is already open.  If it is open it will pop up a msgbox saying it is open by username and then exit sub.  I have found much code to do the file check but I can't get it to work with my macro for some reason.  My issue is that when it runs the check it thinks the file is open already when it isn't.  Does anyone have a good file check with username they can show me?

Outcomes