A list of products available on this site
Documentation for XtraMania's xtras
Prices and links to the online store
Xtras, PDFs, samples
Have a question? Ask us!
Logo. www.xtramaina.com  
Home Search E-mail
VbScriptXtra Samples/Excel

ActiveCompanionSet xtras for Macromedia Director

Typing something in Excel

This handler will run Excel application (if any) create new workbook and print simple message in the first cell of the first sheet.

on testExcel
  -- Creating a new instance of Microsoft Excel
  -- Checking whether object is created
  if not objectP(excel) then
    alert "Failed to create Excel.Application:"&RETURN&excel
  end if
  -- Setting application's window params
  -- Creating new workbook
  -- Getting access to the first work sheet of the newly created work book
  -- Arranging work book window
  -- Setting the value of the left-top cell
  -- Extra parentheses required for Director 7
  (sheet.cells(1,1)).Value="Hello Excel!"
  -- Setting the font style of the left-top cell
  -- Setting the width and height of the cell using range property
  -- Square brackets may be used with single argument

Where to find more info about Excel?

Microsoft Excel contains rather large help system, which contains just everything about Excel. Look at Visual Basic for Excel topics, which describes Excel data model, objects, methods and properties you can use.
Make sure you have installed this part of the help system, since it may not be included in typical installation.

VbScriptXtra provides autodocumentation feature allowing you to see what you can do with particular object instance. Just create a recordset object and type in Messages window:
put interface(excel)
put interface(excel.WorkBooks)
put interface(sheet)
put interface(sheet.cells(1,1))

ObjectBrowser xtra - autodocumentation companion for VbScriptXtra - will show all available Excel interfaces, methods, properties and enumerations.

ObjectBrowser xtra is a part of ActiveCompanionSet. It is available to Download.

Site homeSearchContact author © Eugene Shoustrov. www.xtramania.com