PDA

View Full Version : Microsoft Excel



11-11-2000, 05:27 PM
What Visual Basic code should I use to test if a Workbook is currently in use and amended before attempting to open that workbook.
I am using the following code at present but if the Workbook is currently being amended I get a Windows dialog asking if I want to discard the current changes.
Application.Workbooks.Open 'c:\My Documents\Spread\Films chart.xls'
Sheets('By date').Select
Range('A2').Select
Selection.Sort Key1:=Range('A2'), Order1:=xlAscending, Key2:=Range('B2') _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom