Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Fix code - check to see if a workbook is open, if so, save changes then close.
Added the "If workbook...." command to code. Not working. Any suggestions on how to fix this? Sub Macro7() ' ' Macro7 Macro ' Macro recorded 10/9/2007 by JW' ' Workbooks.Open Filename:="X:\FHI Share\pcp\jeremy\NEW PCP DATA.xls", writerespassword:="pcp123" ActiveWorkbook.RefreshAll ActiveWorkbook.Close SaveChanges:=True If Workbook.Open("X:\FHI Share\pcp\jeremy\PCP DATA UPDATE.xls") Then ActiveWorkbook.Close SaveChanges:=True Workbooks("X:\FHI Share\pcp\jeremy\PCP DATA UPDATE.xls").Close End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
A check box to open and close Columns | Excel Programming | |||
Code to open new workbook, prompt for 'save as' name. | Excel Programming | |||
very difficult code that will close original workbook and leave another open | Excel Programming |