????? ??????? ???? ??? ???? ???????? ?? Visual Basic

?????? ????????? ?????? ?????????
???? ???????: 235883 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

??? ??? ???? ?? ??????? ???? ???? ???????? ?? ?????? ?? ?? Visual Basic ?????? ????? ?? ????? ??????? ???? ???? ???? ???????? ??????? ?? Microsoft Office Web Components. ????? ??? ?????? ????? ????? ???? ?????? ???? ???? ?? ????? Visual Basic ?? ??? ???? ???????? ?? ????????.

??????? ????

????? ????? ?????? ??? ?? Office ??? ????? ?? Visual Basic ???? ??????? ????? ?? ???? ???? ActiveX. ?? ???? ???? ???? ???????? ??????? ?? Office Web Components ???? ???? ?????? ?? ???? ?????? DataGrid ???? ???? ?? Visual Basic. ??????? ?????? ???? ???????? ???? ???????? ??????? ????? ????? ??????? ????? ????????.

???: ??? ????? ????? ?????? ?? ?? ?? Office Web Components ??? ?? ???? ???? ????? ??????? ??? ?????????. ?? ????? ???????? ?? Microsoft Office 2000 ?? ??? ??? ??? ????? ????? ???? Office 2000 ? ???? ????? ???????? ?? ??????? ?????? ??. ?????????? ???? ?? ???? ??? ??? ???????? ????? ????? ??? ??? ?? ???? ?? ?? ??????? ?????? ????? Office 2000. ??? ?? ??????????? ????? ?? ?????? Microsoft Internet Explorer ??????? 4.01 ?? ????.

??????? ??????? ?????? ????? ?????

  1. ????? ????? EXE ????? ???? ?? Visual Basic. ??? ????? Form1 ???? ???????.
  2. ????? ???? ??? Microsoft Office ??? ?????? 9.0.
  3. ????? ???? ???? ???? ???????? ?? ???? ??????? Visual Basic ??? ???????.
  4. ???? ??? ???? ???? ???? ???????? ????????? ??? ???? ??? ?? ???? ????? ?????? ??????? ????? ???? ?????? ?????? ?????? ??? ??????.
????? ?? ???? ???????? ?? Visual Basic ???? ???? ?????? ?????? ??????? ????? ?? ???? ??? ?? Excel. ?????? ?????? ????????? ??????? ???? ???? ???????? ???? ??? ???? ??????? ??? ????? Excel.

??? ???? ???? ???? ????????

????? ????? ?????? ??? ???? ???? ???? ???????? ?? ???? ????? ???????:
  • ????? ???????? ??????? ?? ??????.
  • ??? ?? ??? ???????? ?? ???? Excel ?? ??? ??? ?? ????? Word.
  • ??????? ?????? ?? ??? ??? ?? ???? ???. ?????? ??? ???? ?? ????????? ???? ??????? ????? LoadText ? ??????? ????? HTMLURL ?? ????????? ???????.
  • ????? ?????? ?????? ????? ???? ???????? ?? ????????.
???? ??? ?? ???? ??? ????? ???? ???? ???? ???? ???????? ???????? ??????.

??????? ?????? ???? ??????? ???? ???? ???? ???????? ?? ???????? ?? ????? ?????? ????? Northwind (NWind.mdb):
Sub GetNwindData()

    Dim rstEmployees As Object
    Dim cnn As String
    Dim strSQL As String
    Dim fldCount As Integer
    Dim intIRow As Integer
    Dim intICol As Integer
    Dim varData As Variant

    'Create recordset and fill with records from Northwind sample database.
    Set rstEmployees = CreateObject("ADODB.Recordset")
    cnn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\Program Files\Microsoft Visual Studio\VB98\nwind.mdb"
    strSQL = "SELECT FirstName, LastName, Title, Extension FROM Employees ORDER BY LastName"
    rstEmployees.Open strSQL, cnn, 3 ' adOpenStatic = 3
    
    'Clear any existing values from the spreadsheet control.
    Spreadsheet1.ActiveSheet.Cells(1, 1).Select
    Spreadsheet1.ActiveSheet.UsedRange.Clear

    'Add the field names as column headers.
    For fldCount = 0 To rstEmployees.Fields.Count - 1
        intIRow = intIRow + 1
        Spreadsheet1.ActiveSheet.Cells(1, intIRow).Value = rstEmployees.Fields(fldCount).Name
    Next

    'Fill the control with data from the database.
    Dim iNumCols As Integer
    Dim iNumRows As Integer
    
    iNumCols = rstEmployees.Fields.Count
    iNumRows = rstEmployees.Recordcount
    varData = rstEmployees.GetRows(iNumRows)
    
    For intIRow = 1 To iNumRows
        For intICol = 1 To iNumCols
            Spreadsheet1.ActiveSheet.Cells(intIRow + 1, intICol).Value = varData(intICol - 1, intIRow - 1)
        Next
    Next

    'Format the headers in row 1 with a Bold Font that is 11 points.
    With Spreadsheet1.ActiveSheet.Range(Spreadsheet1.Cells(1, 1),
Spreadsheet1.ActiveSheet.Cells(1, iNumCols)).Font
        .Bold = True
        .Size = 11
    End With
    
    'AutoFit the columns and make all text left-aligned.
    With Spreadsheet1.ActiveSheet.Range(Spreadsheet1.Cells(1, 1),
Spreadsheet1.ActiveSheet.Cells(iNumRows + 1, iNumCols))
        .AutoFitColumns
        .HAlignment = ssHAlignLeft
    End With

End Sub
				


???? ?? ???? ???? ???? ?????? ??? ???? ????? ??? ???? ????? ???. ???? ??????? ActiveSheet ????? ??? ??? ???? ?????.

?????? ??? ???????

??? ????? ???? ??? ????? Office Web Components ????? ?????? ??? ????????? ?? ???? ?????? ???????? ?? ?? ????? ??????? ??? ?? "???? ????? ????? ???? ????????". ???? ????? ????? ???? ????? ????? ??????? ??? ??? ????????? Msowcvba.chm. ?????? ??? ??????? ??? ???? ?????? ?????, ????? ?????? ???????? ?? ???? ??????? F1. ?????? ??? ??????? ??? ????? ??????? ???????? ???? ?????? ????????? ? ???? "???????" ?? Visual Basic ?? Visual Basic for Applications.

???? ??? ???? ???? ????? ??? ???? ???? ???? ??????. ?????? ??? ??????? ?????? ??? ???? ???? ???? ???? ??? ??? ??????? ????? ?????? ?? "????? ??????? ?? Microsoft:
235885????? ??????? ???? ??? ??????? ?? VB

?????

????? ?? ????????? ??? Office Web Components ???? 12 ????? "??????? ??? ?????? ?" ?? ???? Microsoft Office 2000/Visual Basic ????????? ?????.

???????

???? ???????: 235883 - ????? ??? ??????: 26/????? ??????/1425 - ??????: 1.2
????? ???
  • Microsoft Office Spreadsheet Component 9.0
????? ??????: 
kbmt kbhowto kbofficewebspread KB235883 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????235883
????? ??????? ?? ????? ???? ?? ????? ???????
?? ????? ????? ?????? ???? ???? ???? ??? ??????? ??? ?? ? ?? ??? ??????? Microsoft ??? ????? ??? ??????? ????? ?????? ?????

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com