Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
The following coding is working, when the specific file is opened, there is
no need for the drive and directory for closing the file. Workbooks.Open Filename:="E:\dir\File1.xls", UpdateLinks:=3 Workbooks("File1.xls").Close savechanges:=True For the following code, it may contains the drive and directory, and not able to close the file. Does anyone have any suggestions on how to fix the code please? for each mycell in myrng.cells set wkbk = Workbooks.Open (Filename:=mycell.value, UpdateLinks:=3) wkbk.Close savechanges:=True next mycell Thank you for any suggestions Eric Original Coding ================================================== === Option Explicit Sub Temp2() Dim myRng as Range dim myCell as range dim wkbk as workbook with worksheets("sheet9999") set myRng = .range("a2",.cells(.rows.count,"A").end(xlup)) end with for each mycell in myrng.cells set wkbk = Workbooks.Open (Filename:=mycell.value, UpdateLinks:=3) wkbk.Close savechanges:=True next mycell Workbooks("UpdateFiles").Close savechanges:=True End Sub ================================================== === |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
HELP - Too long coding for Macro | Excel Worksheet Functions | |||
coding macro | Excel Discussion (Misc queries) | |||
How to use the if statement for Macro coding? | Excel Worksheet Functions | |||
Hidding Macro names and coding | Excel Discussion (Misc queries) | |||
soft-coding lines in a macro | Excel Discussion (Misc queries) |