Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi. I'm attempting to write a basic macro that imports from an excel file
(called template) information into a spreadsheet. Once imported, I need to copy and paste that information in as values, so that they don't change once the template file changes. This is all working o.k., except that it appears that the copy and paste as values is happening before all the links are finished updating, so sometimes the last couple of cells show #REF#. This is especially true if the template file is not open when the macro is running, but also sometimes happening even if it is open. Can anyone suggest code to ensure all links have finished updating before progressing with the macro. See example code below. There is a whole row of cells that have formulas like the one below entered in... ActiveCell.Formula = "=[Template.xls]Process Evaluation'!$L$9" ActiveWorkbook.UpdateLink , xlLinkTypeOLELinks ActiveWorkbook.Save Range(Selection, Cells(ActiveCell.Row, 1)).Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Selection.Cells(ActiveCell.Row, 1).Select Application.CutCopyMode = False I have Excel 2003 on Windows XP. Thanks in advance! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Updating links | Excel Discussion (Misc queries) | |||
links not updating? | Excel Discussion (Misc queries) | |||
Updating Links | Excel Discussion (Misc queries) | |||
updating links | Excel Discussion (Misc queries) | |||
Updating Links | Excel Worksheet Functions |