# Transfer Data to the Synthesis Data Warehouse (SDW)/VBA

## Tutorial: Transfer Data from an Excel File to the SDW

Below is the VBA version of the tutorial.

VBA

Sub Main()

'Declare a new RawDataSet object.
Dim DataCollection As New RawDataSet

'Name it "New Data Collection," and then specify that
'it is for use with Weibull++.
DataCollection.ExtractedName = "New Data Collection"
DataCollection.ExtractedType = RawDataSetType_Weibull

'Declare a RawData object.
Dim Row As RawData

'Read each row of data from the Excel sheet.
Dim i As Integer, MaxRow As Integer
MaxRow = 20

For i = 2 to MaxRow
Set Row = New RawData

'Set the properties for the current data point.
Row.StateFS = Sheet1.Cells(i, 1)
Row.StateTime = Sheet1.Cells(i,2)
Row.FailureMode = Sheet1.Cells(i,3)

'Add the current data point to the data collection.