Lm th? no ? t? ?ng ho Excel t? m?t VBScript pha khch hng

D?ch tiu ? D?ch tiu ?
ID c?a bi: 198703 - Xem s?n ph?m m bi ny p d?ng vo.
Bung t?t c? | Thu g?n t?t c?

? Trang ny

TM T?T

Bi vi?t ny minh ho? Microsoft Visual Basic, Scripting Edition (VBScript) client-side m? m ra m?t v t? ?ng ha Microsoft Office Excel ho?c Microsoft Excel khi ng?i dng nh?p chu?t vo m?t nt trn m?t trang Web.

THNG TIN THM

Ma mu

  1. T?o t?p HTML sau trong b?t k? tr?nh so?n th?o vn b?n v lu cc t?p tin l c:\excel.htm.
    <HTML>
    <BODY>
    
    <INPUT id=button1 name=button1 type=button value=Button>
    
    <SCRIPT LANGUAGE="VBScript">
    
           sub button1_onclick()
    
              ' Launch Excel
              dim app
              set app = createobject("Excel.Application")
        
              ' Make it visible
              app.Visible = true
        
              ' Add a new workbook
              dim wb
              set wb = app.workbooks.add
        
              ' Fill array of values first...
              dim arr(19,9) ' Note: VBScript is zero-based
              for i = 1 to 20
                 for j = 1 to 10
                    arr(i-1,j-1) = i*j
                 next
              next
        
              ' Declare a range object to hold our data
              dim rng
              set rng = wb.Activesheet.Range("A1").Resize(20,10)
        
              ' Now assign them all in one shot...
              rng.value = arr
        
              ' Add a new chart based on the data
              wb.Charts.Add
              wb.ActiveChart.ChartType = 70 'xl3dPieExploded
              wb.ActiveChart.SetSourceData rng, 2 ' xlColumns
              wb.ActiveChart.Location 2, "Sheet1" 'xlLocationAsObject
        
              ' Rotate it around...
              for i = 1 to 360 step 30
                 wb.activechart.rotation = i
              next
    
              ' Give the user control of Excel
              app.UserControl = true
    
           end sub
    </SCRIPT>
    
    </BODY>
    </HTML>
    					
  2. B?t ?u Microsoft Internet Explorer, lo?i c:\excel.htm trong cc ?a ch? qu?y bar, v sau nh?n ENTER.
  3. Nh?p vo nt ?c hi?n th? trn trang.

    Chu y N?u b?n ang thc ?y b?i m?t c?nh bo b?o m?t v? i?u khi?n ActiveX trn trang, h?y nh?p vo Co.

THAM KH?O

? bi?t thm thng tin, h?y b?m vao s? bi vi?t sau ? xem bi vi?t trong C s? Ki?n th?c Microsoft:
195826CreateObject th?t b?i t? k?ch b?n pha my khch

Thu?c tnh

ID c?a bi: 198703 - L?n xem xt sau cng: 06 Thang Mi 2011 - Xem xt l?i: 3.0
p d?ng
  • Microsoft Office Excel 2007
  • Microsoft Excel 2002 Standard Edition
  • Microsoft Excel 2000 Standard Edition
  • Microsoft Excel 97 Standard Edition
T? kha:
kbhowto kbmt KB198703 KbMtvi
My d?ch
QUAN TRONG: Bi vi?t ny ?c d?ch b?ng ph?n m?m d?ch my c?a Microsoft ch? khng ph?i do con ng?i d?ch. Microsoft cung c?p cc bi vi?t do con ng?i d?ch v c? cc bi vi?t do my d?ch ? b?n c th? truy c?p vo t?t c? cc bi vi?t trong C s? Ki?n th?c c?a chng ti b?ng ngn ng? c?a b?n. Tuy nhin, bi vi?t do my d?ch khng ph?i lc no c?ng hon h?o. Lo?i bi vi?t ny c th? ch?a cc sai st v? t? v?ng, c php ho?c ng? php, gi?ng nh m?t ng?i n?c ngoi c th? m?c sai st khi ni ngn ng? c?a b?n. Microsoft khng ch?u trch nhi?m v? b?t k? s? thi?u chnh xc, sai st ho?c thi?t h?i no do vi?c d?ch sai n?i dung ho?c do ho?t ?ng s? d?ng c?a khch hng gy ra. Microsoft c?ng th?ng xuyn c?p nh?t ph?n m?m d?ch my ny.
Nh?p chu?t vo y ? xem b?n ti?ng Anh c?a bi vi?t ny:198703

Cung cp Phan hi

 

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