Combining files with their respective macros

G

grant

I posted this to Excel only by mistake. This is my first visit to the
newsgroup.

I am using Excel 97 on Windows XP. A friend wrote the following for me
(VBA is a totally alien to me).

The file is called timer Dax.xls. The purpose is to copy a value from
a constantly changing dde-linked cell and copy the latest value into a
column every 1-minute.

I would like to run more than one file (identical but different names)
but can't - only the active file will run.

Therefore, how can I combine/import other files into this?

Obviously, the input/output cells would need to be specified elsewhere,
eg current A, B - ActiveSheet.Range("A65536") and Cells(row,
2).Value = [A1].Value - first new file at cells C, D and second new
file at cells E, F.
VB:

Private Sub CmdClearArea_Click()
ClearArea
End Sub

Private Sub CmdStart_Click()

Dim row As Single
row = ActiveSheet.Range("A65536").End(xlUp).row + 1
Cells(row, 1).Value = Time()
Cells(row, 2).Value = [A1].Value

StartTimer
End Sub


Private Sub CmdStop_Click()
StopTimer
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
StopTimer
End Sub

This is the procedure to activate (dde source is running):

Open Excel,
open file called timer DAX.xls,
Enable macros,
Update linked information,
Tools,
Macro,
Macros,
click MyFunc,
Run.

Data starts to update. As this is the only file open, this (presumably)
is the active file.

On opening another file: repeat the above for next file (timer
STOXX.xls). The blue title/heading bar is blue indicating (?) this is
now the active file; title bar of the previous file (timer DAX.xls) is
now grey and is not updating. Click on this and it updates, but the
other file stops.

Any advice would be greatly appreciated.

Grant.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top