As I get used to using Assisi I find the Cruise.xlsm to be buggy a hard to use. Many time when attempting to validate the data it deletes fields and replaces the with "#Value!". I find importing data using .csv files to be a little more consistent.
That being said the Import feature within Assisi requires .ini files to map the schema. I created an Excel Macro that outputs these and the .csv files based on data in sheets. The only thing you need to do is name your Sheets and make sure the Column names match the column in the database.
The current version works for Cruise, Plots and Trees tables. Note that each sheet will need the "ThisSheet" object set to match the sheet names.
Just copy and past this whole mess in and Excel Module. Feel free to add or alter any of this code.
Enjoy!
Option Explicit
Declare PtrSafe Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
Public Sub ExportToIni(headers As Range, csvName As String, iniPath As String)
If Dir(iniPath) <> "" Then Kill iniPath
WritePrivateProfileString csvName, "ColNameHeader", "True", iniPath
Open iniPath For Append As #1
Print #1, "Format=CSVDelimited"
Dim c As Range
Dim i As Integer
Dim datatype As String
i = 1
For Each c In headers
Select Case c.Value
Case "Unit": datatype = "Char"
Case "Stand": datatype = "Char"
Case "Cruise": datatype = "Char"
Case "Plot": datatype = "Long"
Case "Tree": datatype = "Long"
Case "SubPlot": datatype = "Long"
Case "Count": datatype = "Single"
Case "Species": datatype = "Char"
Case "DBH": datatype = "Single"
Case "FormFactor": datatype = "Single"
Case "FormPointHeight": datatype = "Single"
Case "CrownBaseHeight": datatype = "Single"
Case "CrownClass": datatype = "Char"
Case "MerchHeight": datatype = "Single"
Case "MerchDiameter": datatype = "Single"
Case "MerchPercentDiameter": datatype = "Single"
Case "TotalHeight": datatype = "Single"
Case "IsBrokenTop": datatype = "Bit"
Case "BrokenHeight": datatype = "Single"
Case "BrokenDiameter": datatype = "Single"
Case "IsSiteTree": datatype = "Bit"
Case "BreastHeightAge": datatype = "Single"
Case "IsOffPlot": datatype = "Bit"
Case "Damage": datatype = "Char"
Case "DecayClass": datatype = "Char"
Case "BoardDefect": datatype = "Single"
Case "IsSnag": datatype = "Bit"
Case "IsStanding": datatype = "Bit"
Case "Notes": datatype = "Char"
Case "CruiseDesign": datatype = "Char"
Case "CruiseDate": datatype = "Date"
Case "Area": datatype = "Single"
Case "StandType": datatype = "Char"
Case "SubPlot1BAF": datatype = "Single"
Case "SubPlot1MinDBH": datatype = "Single"
Case "SubPlot2Radius": datatype = "Single"
Case "StandNotes": datatype = "Char"
Case "Recorder": datatype = "Char"
Case "Latitude": datatype = "Single"
Case "Longitude": datatype = "Single"
End Select
Print #1, "Col" & i & "=" & Chr(34) & CStr(c.Value) & Chr(34) & " " & datatype
i = i + 1
Next
Close #1
End Sub
Public Sub ExportCSV(headerRange As Range, CurrentSheet As Worksheet, PathName As String)
Dim totline As Long
Dim lastcol As Long
Dim i As Long
Dim TempWB As Workbook