本文发表在 rolia.net 枫下论坛I use this Macro to open over 30 files in one folder, this error only happens when open one of these files (all files have identicla formate and layout).
Here is my code,
For j = 1 To NumFiles
Application.ScreenUpdating = False
SiteFilePathname = Sheets("AllDataSheet").Cells(5 + j, "C").Value
SiteFileName = Sheets("AllDataSheet").Cells(5 + j, "D").Value
Workbooks.Open FileName:=SiteFilePathname, UpdateLinks:=0
'Using Site File Name as Site Name Code, a very lengthy formula!!
Sheets("menu").Cells(6, "I").Value = "=LEFT(MID(CELL(""FILENAME"",F9),FIND(""["",CELL(""FILENAME"",F9))+1,FIND(""]"",CELL(""FILENAME"",F9))-FIND(""["",CELL(""FILENAME"",F9))-1),LEN(MID(CELL(""FILENAME"",F9),FIND(""["",CELL(""FILENAME"",F9))+1,FIND(""]"",CELL(""FILENAME"",F9))-FIND(""["",CELL(""FILENAME"",F9))-1))-4)"
Call CheckIfIsTempFile
Next
End of code更多精彩文章及讨论,请光临枫下论坛 rolia.net
Here is my code,
For j = 1 To NumFiles
Application.ScreenUpdating = False
SiteFilePathname = Sheets("AllDataSheet").Cells(5 + j, "C").Value
SiteFileName = Sheets("AllDataSheet").Cells(5 + j, "D").Value
Workbooks.Open FileName:=SiteFilePathname, UpdateLinks:=0
'Using Site File Name as Site Name Code, a very lengthy formula!!
Sheets("menu").Cells(6, "I").Value = "=LEFT(MID(CELL(""FILENAME"",F9),FIND(""["",CELL(""FILENAME"",F9))+1,FIND(""]"",CELL(""FILENAME"",F9))-FIND(""["",CELL(""FILENAME"",F9))-1),LEN(MID(CELL(""FILENAME"",F9),FIND(""["",CELL(""FILENAME"",F9))+1,FIND(""]"",CELL(""FILENAME"",F9))-FIND(""["",CELL(""FILENAME"",F9))-1))-4)"
Call CheckIfIsTempFile
Next
End of code更多精彩文章及讨论,请光临枫下论坛 rolia.net