Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a workbook if not opened, going to it if already opened
Your code works great...just one problem. When the workbook file is already open, the code makes the workboo re-open(thus asking me if I want to save changes). How can I change the code so that if its already open, it just leave it on(without closing and then re-opening). Thank -- neotoky ----------------------------------------------------------------------- neotokyo's Profile: http://www.excelforum.com/member.php...fo&userid=1389 View this thread: http://www.excelforum.com/showthread.php?threadid=26327 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a workbook if not opened, going to it if already opened
No, my code doesn't do that.
Apparently you have screwed it up. My code is tested and works fine: Sub BBB() Dim wkbk As Workbook On Error Resume Next Set wkbk = Workbooks("ABC.xls") On Error GoTo 0 If wkbk Is Nothing Then Set wkbk = Workbooks.Open("C:\Myfiles\ABC.xls") End If wkbk.Activate End Sub did you change the name from ABC.xls and C:\MyFiles\ABC.xls to the name/path and name of your workbook - perhaps you have misspelled the name. -- Regards, Tom Ogilvy "neotokyo" wrote in message ... Your code works great...just one problem. When the workbook file is already open, the code makes the workbook re-open(thus asking me if I want to save changes). How can I change the code so that if its already open, it just leaves it on(without closing and then re-opening). Thanks -- neotokyo ------------------------------------------------------------------------ neotokyo's Profile: http://www.excelforum.com/member.php...o&userid=13892 View this thread: http://www.excelforum.com/showthread...hreadid=263271 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is there away to keep Excel from opening a copy of an already opened workbook and the pages not be at 100% but | New Users to Excel | |||
Opening a workbook if not opened, going to it if already opened | Excel Programming | |||
How to see if the opened workbook is opened by another user ? | Excel Programming | |||
Sheets select method fails when workbook is opened by another workbook | Excel Programming | |||
opening diff. worksheets in opened workbook | Excel Programming |