Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I export a row of data into its own workbook | Excel Worksheet Functions | |||
How do I export data from a workbook to an email | Excel Discussion (Misc queries) | |||
import/export data from a workbook | Excel Discussion (Misc queries) | |||
How to export data to a closed Workbook | Excel Programming | |||
Create workbook for data export and then data import? | Excel Programming |