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: 106
Default Export Data to CSV without closing source workbook

I have a workbook which is used by payroll clerks to input time sheet
data for employees. Based on the input, the spreadsheet performs
calculations on a separate sheet, and I would like to export that data
to a csv file. I created a command button to do this which contains
the following code. When the command is run, the CSV file is created;
however, the original workbook is closed and the user has to reopen it
to continue working. Is there any way to export data from a sheet in a
workbook to a CSV file without closing the original workbook?

Private Sub CreateUploadFile_Click()
Sheets("Upload Data").Select
Dim FName As String
FName = "Upload" & Format(Now(), "yyyymmmddhhmm")
ActiveSheet.Copy
ActiveSheet.SaveAs FName & ".csv", FileFormat:=xlCSV
MsgBox "Save File Complete"
End Sub

Any help would be great!

CJM

 
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
How do I export a row of data into its own workbook LMM_0809 Excel Worksheet Functions 1 August 27th 09 04:03 PM
How do I export data from a workbook to an email A Rutherford Excel Discussion (Misc queries) 1 May 19th 09 07:22 PM
import/export data from a workbook ajn Excel Discussion (Misc queries) 1 December 8th 06 01:44 PM
How to export data to a closed Workbook newbie[_4_] Excel Programming 1 July 20th 05 09:57 AM
Create workbook for data export and then data import? Kevin G[_2_] Excel Programming 0 February 4th 04 04:10 AM


All times are GMT +1. The time now is 04:17 PM.

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"