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: 1
Default Auto refresh and DDE update is not work when running macro

Hi all,

I used to monitor my updated stocks quotes in an excel file (stock.xls)
where the data comes from an html websites (iexplorer exports to ms-excel).
Data refresh interval is not less than 1 minute.

I need to save the txt format of my worksheet every one minute for a purpose.
A friend of mine assists me to create a simple macro like this below:

======================
Sub savetext()

'
' kirim Macro
' Macro recorded 3/14/2004 by Eddy
'
' Keyboard Shortcut: Ctrl+k
'
On Error Resume Next

Dim PauseTime, Start, Finish
MsgBox "Starting Macro (save to c:\data.txt)"
PauseTime = 60 ' Set duration.
Start = Timer ' Set start time.
Do While 1

If Timer Start + PauseTime Then
'MsgBox "saving"
Finish = Timer

ActiveWorkbook.SaveCopyAs "c:\data.xls"

Workbooks.Open "c:\data.xls", 3
'ActiveWorkbook("BARU").Activate

'Shell ("del c:\data.txt")
Set fs = CreateObject("Scripting.FileSystemObject")
fs.DeleteFile "c:\data.txt", True

ActiveWorkbook.SaveAs "c:\data.txt", xlTextMSDOS
ActiveWorkbook.Close True

Start = Timer
Else
DoEvents ' Wait
End If
Loop

End Sub

==================================

This macro really did saving a file called 'data.txt' every one minute
via a workbook backup file called 'data.xls',
but when this macro run, it results the excel's auto refresh is not work

It also occurs when I run a worksheet where the data comes from a DDE server.

I have set macro security level to low and trust every source.


Thanks for any suggestion

EDDY
 
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
Macro to update a column in a work based on another work sheet WickerMan New Users to Excel 1 December 4th 09 12:58 PM
Macro for auto refresh Kim Excel Discussion (Misc queries) 1 October 6th 09 02:22 PM
EXCEL 2007 CHART REFRESH WHILE MACRO IS RUNNING MikeM Charts and Charting in Excel 1 April 20th 09 07:38 AM
Running a macro from an auto-refresh Chris Youlden Excel Worksheet Functions 2 October 7th 07 04:22 PM
Macro Auto-refresh? Marty Reinders Excel Programming 0 August 4th 03 07:21 PM


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

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

About Us

"It's about Microsoft Excel"