ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CSV dump (https://www.excelbanter.com/excel-programming/423877-re-csv-dump.html)

Dave Peterson

CSV dump
 
No. But I bet you don't notice too much of a delay.

rjre wrote:

can i force it into the background...as i do not want any pause in
being able to work on the active workbook?

thx

On Feb 11, 1:41 pm, Dave Peterson wrote:
I would add a button from the Forms Toolbar and assign it a macro that does all
the work:

Option Explicit
Sub testme()
Dim wks As Worksheet
Dim WksToSave As Worksheet

Set wks = ActiveSheet
wks.Copy 'to a new workbook

With ActiveSheet
'just overwrite the .csv file, don't give me a warning
Application.DisplayAlerts = False
.Parent.SaveAs _
Filename:="C:\" & Format(Now, "yyyymmdd_hhmmss") & ".csv", _
FileFormat:=xlCSV
Application.DisplayAlerts = True
.Parent.Close savechanges:=False
End With

End Sub

It's the equivalent of copying the activesheet to a new workbook and saving that
new workbook as a .csv file.

Change the path (it has to exist!) to what you want.

rjre wrote:

I would like a workbook to dump a particular sheet every few minutes
to a CSV file. The sheet itself doesn't contain a large amount of data
(maybe 30 columns by 200 rows) - but we need to be able to show/
reconcile what was on the sheet at a particular time/date.


Do you guys out there have any suggestions for the most unobtrusive
way to do this? ie: performing a File-Save AS function ties up the
app for a few seconds.


thank you very much


richard


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 01:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com