DumpToSheet
Dumps data from a source, or from the current instance, to an Excel WorkSheet.
Syntax
expression.DumpToSheet([WBookName], [SheetName], [RngName:= “A1”], [DataSource:= Nothing], [BlockAutoFormat:= True])
Parameters
| Part | Description | 
|---|---|
| WBookName | Optional. Identifier specifying a StringType variable representing the output Workbook name. | 
| SheetName | Optional. Identifier specifying a StringType variable representing the output Worksheet name. | 
| RngName | Optional. Identifier specifying a StringType variable representing the name of the output top left-most range. | 
| DataSource | Optional. Identifier specifying a CSVArrayListobject variable representing the data to copy from. | 
| BlockAutoFormat | Optional. Identifier specifying a BooleanType variable. | 
| DrawCellBorders | Optional. Identifier specifying a BooleanType variable. | 
Returns value
Type: String
📝Note
Before dump data, is required to make a call to the
ImportFromCSVorImportFromCSVstringmethod.
- See also
- ImportFromCSV method, ImportFromCSVstring method.
Behavior
When the WBookName parameter is omitted the data is dumped into the Workbook that holds the CSV interface’s VBAProject. Omitting the SheetName parameter adds a new Worksheet to the desired Workbook. Also, if the RngName parameter is omitted the data will dumped starting on the “A1” named cell in the desired Worksheet. Use the BlockAutoFormat parameter if you believe that the target CSV data may induce some sort of injection to your machine.
📝Note
When the DataSource parameter is omitted the
DumpToSheetmethod dumps all data stored in the current instance. If the user specified a data source, its data will be dumped.
☕Example
Sub DumpToSheet()
    Dim CSVint As CSVinterface
    
    Set CSVint = New CSVinterface
    With CSVint.parseConfig
        .path = Environ("USERPROFILE") & "\Desktop\Demo_100000records.csv"
    End With
    With CSVint
        .ImportFromCSV .parseConfig                              'Import CSV data
        .DumpToSheet SheetName:="Dump demo", rngName:="C6"       'Dump the internal data to the 
                                                                 '"Dump demo" sheet starting on the range "C6".
    End With
    Set CSVint = Nothing
End Sub