lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Does anyone know why the last line here fails?

  -- test.lua
  excel = luacom.CreateObject("Excel.Application")
  excel.Visible = true
  wb = excel.Workbooks:Add()
  ws = wb.Worksheets(1)
  ws.Cells(1,1).Value = "test"

  COM exception:(.\src\library\tLuaCOM.cpp,398):Type mismatch.
  stack traceback:
        [C]: ?
        stdin:1: in main chunk
        [C]: ?

It works fine in JavaScript (cscript.exe):

  // test.js
  excel = WScript.CreateObject("Excel.Application");
  excel.Visible = true;
  wb = excel.Workbooks.Add();
  ws = wb.Worksheets(1);
  ws.Cells(1,1).Value = "test";

I tried this with luacom 1.3 in Lua 5.0.2 since luacom is slightly broken in Lua
5.1 as noted here: