/**
 * <p>Title: Excel</p>
 * <p>Description: Create an ActiveXComponent for Microsoft Excel
 * and wrap Excel functions and properties.</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: Izyn Technologies</p>
 * @author Richard Norton
 * @version 1.0
 */

package izyndoc;

import com.jacob.com.*;

public class Excel extends com.jacob.activeX.ActiveXComponent
{
  /**
   * Constructor.
   */
  public Excel()
  {
    super("Excel.Application");
  }

  /**
   * Gets the Property Workbooks.
   * This is an Object that has a number of capabilities,
   * such as Open, and also holds the Workbook collection.
   *
   * @return ExcelWorkbooks
   */
  public ExcelWorkbooks getWorkbooks()
  {
    return new ExcelWorkbooks(this.getProperty("Workbooks").toDispatch());
  }

//  /**
//   * Bring the Application to the foreground (in to focus).
//   *
//   */
//  public void activate()
//  {
//    this.call(this, "Activate");
//  }

//  /**
//   * Quit the Application.
//   *
//   * @param options Variant[]
//   */
//  public void quit(Variant[] options)
//  {
//    this.invoke("Quit", options);
//  }

  /**
   * Change Excel visible property.
   *
   * @param isVisible boolean
   */
  public void setVisible(boolean isVisible)
  {
    this.setProperty("Visible", new Variant(isVisible));
  }

  /**
   * Get Excel version property.
   *
   * @return String
   */
  public String getVersion()
  {
    return this.getProperty("Version").toString();
  }
}