XL: ?????? ????? ?? ????? ?????? ??? Excel ???????? ???????

?????? ????????? ?????? ?????????
???? ???????: 177991 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

?????? ??? ??????? ???? ?? ????? ????? ??? ????? ??? Microsoft Excel ?????? ??????? ???????? ???????. ??? ????? ??? ?????? ?? ????? ????? ??? ??????? ?? ????????? ???????? ???????.

??????? ????

???? Microsoft ??????? ???????? ??? ??? ?? ???? ??????? ?? ?? ????? ? ? ?? ????? ??? ?????? ???????? ??????? ?/?? ???????? ???? ????. ????? ??? ??????? ??? ????? ??? ??? ??????? ???? ?? ????? ???????? ????????? ?????? ????????? ????????. ???? ?? ????? ??????? ????? Microsoft ??? ????? ????? ???? ???? ?? ?????? ?????? ??? ??????? ?????? ????? ?????? ?? ????? ??????? ?????? ????????? ???????.
??? ??? ??? ?? ???? ???? ???? ?????? ?? ???? ???????? ?? ????? ??? ??????? ????? Microsoft ?? ????? ???????. ????? ?? ?????????? ?? ?????? ????? ??? Microsoft ???:

Microsoft ????????? Partners ? https://partner.microsoft.com/global/30000104

????? Microsoft ??????? ???? ???? ??????? - http://support.microsoft.com/gp/advisoryservice

?????? ??? ???? ?? ????????? ??? ?????? ????? ???????? ???? ????? ??????? ????? Microsoft ?? ?????? ???? Microsoft ?????? ??? ?????: http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS??? ????? ????? ??? Microsoft Excel ???????? ???????, ????? ?????? ??????? ????? ?????? Excel ? ?? ??? ??? ??? ????? ?????? ??? ???? ???? ??? ?? ?????? ??? ?????. ???? ??????? ??????? ???????? ??????? ?????? ?????? ??? ??????.
   Version of          Passing Array to     Passing Array to
   Microsoft Excel     Worksheet Range      Macro (Procedure)
   ----------------------------------------------------------

   5.0                        A                B,C

   7.0 (Excel 95)             D                E,C,H

   8.0 (Excel 97)             F                G,H

   9.0 (Excel 2000)           F                G,H

				

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

?:

????? ?????? ?? ??????? ?? ?????? ?? 6550 ???????. ??? ????? ??? ???? ????? ???? ?? ????? ????? ??????? ?? ??????:
???? ???????
1005: ??? ???? ??? ????? ????? ???? ??? ??????
????? ?????? ?? ??????? ?? ?????? ???? ???? ?????? ??? Excel ???????? ?????? ????? Excel ?? 4095. ??? ????? ??? ???? ????? ????? ????? ???????:
??? ??? ??????? '1004':
????? ???? ????? ??? ????? ???
b:

????? ?????? ?? ??????? ?? ?????? ?? 4095. ??? ????? ??? ???? ?? ????? ????? ????? ???????:
??? ??? ??????? '1004':
????? ????? ??? ????? ???
??????: ??? ????? ???? ?????? ???????, ?? ?? ????? ????? ??? ???? ?? ???? ????? ?????? ?????? ??? ??????? 4095 Excel ???? ???????.

c:

??? ????? ????? ?????? ?? ????? Excel ? ??? ????? ??????? ????? ?? ??? ????? ????? ????? ??????? ??? ?????? ????? ??????? ???????? ???????:
??? ??? ??????? '1004':
?? ???? ?????? ??? ??????? < ??? ??????? >
??? ???? ??????? ????? ?? AcceptArray ?? ??? ??????? ?? Excel. ????? ??? ???? ?? ????? ??? ????? ?????? ?? ????? Excel:
   Public Sub AcceptArray(ByVal myarray As Variant)
      ' You can pass the parameter either ByVal or ByRef.
      ' To determine the number of elements in the array, use
      ' the UBound function.
   End Sub
				
D:

????? ?????? ?? ??????? ?? ?????? ?? 5461. ??? ????? ??? ???? ????? ???? ????? ????? ???????:
??? ??? ??????? '1004':
????? ???? ????? ??? ????? ???
- ?? -
??? ??? ??????? '1005':
??? ???? ??? ????? ????? ???? ??? ??????
e:

????? ?????? ?? ??????? ?? ?????? ?? 5461. ??? ????? ??? ???? ????? ????? ????? ???????:
??? ??? ??????? '1004':
????? ????? ??? ????? ???
f:

??? ????? ???? ?????? ???? ??????? ?? ?????? ?????? ??????? ???????? ?? Excel ???? ??? ????? ?????? (???? 65536 256 X ?????). ??? ???? ???? ?????? ???? ??????? ?? ?????? ????? ????? ??? Excel ??????? ????? Excel ?? ?????? 5461. ??? ????? ??? ???? ????? ????? ????? ???????:
??? ??? ??????? '13':
??? ????? ?????
g:

??? ????? ???? ?????? ???? ??????? ?? ?????? ??? ???????? ????????. ?????? ?? ???? ????? ??????? ?????? ????? ?? ????? Excel. ??? ???? ??? ??? ???? ????? ?????? ByVal ? ??? ???? ????? ??????? ?????? Variant ??? ?? ???? ?? ?????? ?? ??????? ??????? C ?? ??? ???????. ????? ??? ??? ??? 13, "??? ????? ???" ??? ??? ????? ????? ??????? ??? ?????.

h:

??? ????? ????? ByRef ??? ????? ???? ??????? ??????? ??? Excel? ??? ????? ??????? ???????? ??? ??????? ???? ?????? (?? ????) ? ?????? ??? ??????? ??? ?????? ??????. ???? ???? ??? ????? ??? ????? ???? ??? Excel ???????? ByRef ? ??? ????? ???? ?? ?????? ??? ????? ??????? ?? Excel. ??? ????? ??????? Excel, ??? ????? ???? ?? ?????? ??? ??????. ??? ????? ?? ??? ?????? ?? ????? ??????? ???????? ByRef ??? ???? ???? ????? ??? ??????. ??? ????? ????? ??? ??????? ???? ??????? ???????? ??? ??????? (????? ???????? ?????? (DLL)) ???? ????? ????? ByRef ? ???? ?????? ??? ????? ?? ???????. ?????? ?????? ?????? ??? ?? ??????? ??? ??????. ???? ???? ??? ????? ?????? ?? ??? ????? ??????? ??? ??????.

????? ??????? ?? ???? ???? ????? ??? Excel ? ??? ???? ?????? ????? ???? ByVal ????? ?? ByRef. ???? ???????? ??? ????? ???? ????? ??? ??? Excel ??? ??? ???? Excel ?????? ?????? ??? ??????. ???????? ???? ByVal ??? ????? Excel ??? ????? ??????? ?? ????? Excel ?????? Variant. ???? ??????? ??????? C ?? ??? ??????? ?????? ??? ????.

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

??? ????? Microsoft Visual Basic ?? Sub ??????? ????? ????????? ????? ????? ????? ??? Excel. ????? ????????? ??????? ????? ????? ???? ?? ??????? ?? ???? ??? ?????? ????? ???? ??? ???? ???? ???. ???? ??????? ?????? ????? ????? ???? ??? ????? Excel.

??? ??????? ????????? ??????? ?? ?? ??????:
?????? Explicit
xlApp ??? "?????"
xlBook ??? "?????"
xlSheet ??? "?????"
????? ???? 1 ??????? ??? ???? ???? ?????:
   Public Sub OneDimension()
      Const size = 5461
      Dim myarray(1 To size) As Integer
      Set xlApp = CreateObject("Excel.Application")
      xlApp.Visible = True
      Set xlBook = xlApp.Workbooks.Add
      Set xlSheet = xlBook.Worksheets("Sheet1")
      xlSheet.Cells(1, 1).Resize(size, 1).Value = _
         xlApp.Application.Transpose(myarray)
   End Sub
				
????? ???? ????? ??????? ??? ???? ???? ?????:
   Public Sub TwoDimension()
      Const size = 2730
      Dim myarray(1 To size, 1 To 2) As Integer
      ' Number of elements = 2730 * 2 = 5460.
      Set xlApp = CreateObject("Excel.Application")
      xlApp.Visible = True
      Set xlBook = xlApp.Workbooks.Add
      Set xlSheet = xlBook.Worksheets("Sheet1")
      xlSheet.Cells(1, 1).Resize(size, 2).Value = myarray
   End Sub
				
????? ???? ?? ????? ??? ????? Excel:
   Public Sub RunExcelMacro()
      Const size = 5461
      Dim myarray(1 To size) As Integer
      Set xlApp = CreateObject("Excel.Application")
      xlApp.Visible = True
      Set xlBook = xlApp.Workbooks.Open("C:\MyBook.xls")
      xlApp.Run "AcceptArray", myarray
   End Sub
				
??????? AcceptArray ??? ?????? ????? ???? C:\MyBook.xls ??? ???:
   Option Explicit

   Public Sub AcceptArray(ByVal myarray As Variant)
      MsgBox "Size of first dimension: " & UBound(myarray, 1)
   End Sub
				

?????

????? ?? ????????? ??? ????? ? Excel ?????? ?????? ???????? ??????? ?? "????? ????? Microsoft:
166342XL97: ???? ?????? ???? ???? ?? Microsoft Excel 97

153307HOWTO: ??????? ????? ????? Microsoft Excel ??? ??????

153090????? ????? ???? Visual Basic ??? ???? ??? Excel
?????? ??? ???? ?? ????????? ??? ?????? ??? ??????? Visual Basic for Applications ?????? ?????? ??????? ??????? ?? "????? ??????? ?? Microsoft:
163435VBA: ????? ????? Visual Basic ?????????

???????

???? ???????: 177991 - ????? ??? ??????: 10/???? ?????/1428 - ??????: 3.6
????? ???
  • Microsoft Excel 2000 Standard Edition
  • Microsoft Excel 97 Standard Edition
  • Microsoft Excel 95 Standard Edition
  • Microsoft Excel 95a
  • Microsoft Excel 5.0c
  • Microsoft Office 2000 Developer Edition
????? ??????: 
kbmt kbautomation kbinfo KB177991 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????177991

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

 

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