LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
changes in destination file should update sourse file ASR Excel Discussion (Misc queries) 3 April 17th 09 06:53 AM
Macro to pull data from another file - update name of file Don Excel Discussion (Misc queries) 2 February 10th 09 03:31 PM
i want to update one excel file the other one update automaticaly Basant New Users to Excel 1 December 16th 06 12:50 AM
Automatic update of links in destination file when source file mo. Brucgil Excel Discussion (Misc queries) 0 December 2nd 04 04:07 PM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


All times are GMT +1. The time now is 09:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"