lua-users home
lua-l archive

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


Hello,

Lua 5.1.4 / WinXP / MS Excel 2003

New to COM and finding it rather... comfusing. Example of problem:


-- addpolyline.lua
require "luacom"
local xlApp = assert(luacom.CreateObject("Excel.Application"))
local xlBook = xlApp.Workbooks:Add(1)
local xlSheet = xlBook.Worksheets(1)
xlApp.Visible = true
local line = xlSheet.Shapes:AddPolyline({{25, 100}, {100, 150}})


$ lua addpolyline.lua
V:\msys\1.0\local\bin\lua.exe: addpolyline.lua:7: COM error:
(v:/src/lang/lua/davidm-luacom-91fc072/src/library/tLuaCOM.cpp,408):
Memory is locked.
stack traceback:
        [C]: in function 'AddPolyline'
        addpolyline.lua:8: in main chunk
        [C]: ?


I suspect that the table of coordinate pairs I'm passing is not
being coerced into the "SafeArrayOfPoints" (of type 'Single') that
AddPolyline requires. Can this be done with stock LuaCOM?

Thank you,
Dean.