Показать сообщение отдельно

  #14  
Старый 08.11.2007, 00:11
hidden
Постоянный
Регистрация: 23.04.2006
Сообщений: 622
С нами: 10552646

Репутация: 1292


По умолчанию

Вот
Код:
Sub SendByPOST()
  query = ""
  For RowCount = 1 To Selection.Rows.Count
    If RowCount > 1 Then
      query = query & Chr(13)
    End If
    For ColumnCount = 1 To Selection.Columns.Count
    If ColumnCount > 1 Then
      query = query & Chr(9)
    End If
      query = query & ActiveSheet.Cells(1, Selection.Column + ColumnCount - 1).Text & ":" & Selection.Cells(RowCount, ColumnCount).Text
    Next ColumnCount
  Next RowCount
    
  Set xmlReq = CreateObject("Microsoft.XMLHTTP")
  xmlReq.Open "POST", "http://localhost/xls.php", False
  xmlReq.setRequestHeader "Content-Type", "text/xml"
  xmlReq.setRequestHeader "Connection", "Close"
  xmlReq.setRequestHeader "Content-length", Len(query)
  xmlReq.send (query)
  If (xmlReq.Status >= 200 And xmlReq.Status < 300) Then
    MsgBox "Done"
  Else
    MsgBox "Filed: " & xmlReq.Status
  End If
End Sub
Подразумевается что имена колонок народятся в первой строке, иначе "...Cells(1, Sele..." тут нужно указать строку.
 
Ответить с цитированием