I have Created an app that can open up an excel template, let the user enter info and then I save the entered info to my SQL database. What I do for easy cell access I have defined a name for each cell the user can enter info into so i can track down where the info came from. here is my code to save the excel info into SQL.

VB Code:
  1. Private Sub SaveInfo()
  2. On Error GoTo Handler
  3.     Dim info() As String, test() As String
  4.     Dim strSummary As String
  5.     Dim i As Integer
  6.     Dim strPricing As String
  7.    
  8.     'MouseIcon = vbHourglass
  9.    
  10.     ReDim info(0)
  11.     With xls
  12.         Dim a As String, b As String, c As String
  13.        
  14.         '--Set intial and max value for progress bar
  15.         pbExcel.Value = 0
  16.         pbExcel.Max = .Workbooks(1).Names.Count
  17.        
  18.         '--loop thru all the Excel work book Names
  19.         '---This also includes some names that were probably pre-defined
  20.         For i = 1 To .Workbooks(1).Names.Count
  21.             Debug.Print i
  22.            
  23.             '--This function Figures out which sheet the Name came from.
  24.             '--If the Name is not a name I defined the return value is "Stop"
  25.             a = GetSheet(.Workbooks(1).Names(i).Name)
  26.             Debug.Print .Workbooks(1).Names(i).Name
  27.            
  28.             '--If the defined name leads with "S_" then add value to strSummary
  29.             If Left(.Workbooks(1).Names(i).Name, 2) = "S_" Then
  30.                 'Debug.Assert .Workbooks(1).Names(i).Name <> "S_OtherHO"
  31.                 strSummary = strSummary & .Sheets(a).Range(.Workbooks(1).Names(i).Name).Value & "@" & .Workbooks(1).Names(i).Name & ";"
  32.             Else
  33.                 '--If Sheet doesn't equal Stop then it is a name I assigned to the cell
  34.                 If a <> "Stop" Then
  35.                                        
  36.                     '--EX: 1.25 @ FLD_CELL
  37.                     strPricing = .Sheets(a).Range(.Workbooks(1).Names(i).Name).Value & "@" & .Workbooks(1).Names(i).Name & ","
  38.                                     End If
  39.             End If
  40.             pbExcel.Value = i
  41.         Next i
  42.     End With
  43.        
  44.     AddPricingInfo strPricing, strSummary
  45.     'Screen.MousePointer = 99
  46.     MsgBox "Saved Successfully", vbInformation
  47. Exit Sub
  48. Handler:
  49.     Select Case Err.Number
  50.         Case 13
  51.             Resume Next
  52.         Case Else
  53.             Err.Raise Err.Number, Err.Source, Err.Description
  54.     End Select
  55. End Sub

The code is a bit ugly, but it works. The only problem is there are roughly 600 cells this thing has to go thru and it take about 15-20 seconds to do so. Can anyone come up with a faster way of doing this?

The reason I Concatinate all the cell values together is, so i can store the value in only one field in my database. The alternative would be to make 600 columns, not a very nice option.

again, any suggestions on how to speed this up would be GREATLY appreciated.

Scott