Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
update file by DDE
Hi,
the code I inserted below, has got a problem. It refers to the initially loop. My aim is: open files, update them by DDE connection, save them. I'd like to use a loop procedure (or something similar), that opens files one by one. So every file is opened, then updated, then saved. But loop goes fast and opens all files at the same time and the code runs wrong. I tried to use Application.OnTime method to manage the "timing" about the opening of the files, but I hadn't good results. Do you know something else to solve the problem or tell me where my code is wrong? I also used "inputbox" instead of the loop; but "inputbox" is good if I've got only some file.. if I've got many files, it takes me more time. Thank you very much for your help, deborah '========================================== Option Explicit Dim WB As Workbook Dim arrFiles() Dim sFile As String Dim i Dim A '------------------------------------------ Sub verification() Dim sPath As String Dim File As String sPath = "C:\Files\" arrFiles = Array("Alfa", "Beta") For i = 0 To 1 sFile = Dir(sPath & arrFiles(i) & "*.xls") Workbooks.Open (sPath & arrFiles(i)) Set WB = ActiveWorkbook LinkList End If Next i End Sub '----------------------------------------------- Private Sub LinkList() Dim Links As Variant Links = WB.LinkSources(xlOLELinks) If Not IsEmpty(Links) Then For A = 1 To UBound(Links) WB.SetLinkOnData Links(A), "LinkChange" Next A Else MsgBox "This workbook does not contain any links" & _ "to other workbooks" End If End Sub '------------------------------------------------ Private Sub LinkChange() ''''' End Sub '------------------------------------------------ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
changes in destination file should update sourse file | Excel Discussion (Misc queries) | |||
Macro to pull data from another file - update name of file | Excel Discussion (Misc queries) | |||
i want to update one excel file the other one update automaticaly | New Users to Excel | |||
Automatic update of links in destination file when source file mo. | Excel Discussion (Misc queries) | |||
Automate open file, update links, run macro, close and save file | Excel Programming |