ricozone
10-22-2009, 04:49 PM
Hi,
I'm searching a way to create, write and save via maxscript a excel (.xls) file. I know that i can open excel file via OLEobject but i don't know how to format and save it.
For example, i want to create a contactsheet of all objects in a scene
for each xls line --> put the preview (.jpg file) and the name of current object.
So cell A1= preview, cell B1= string name... and so on for each object.
I can't find documentation on how to format data for .xls filetype.
And, is there a way to put in excel (maybe via clipboard) a rendered image ?
xl = createOLEObject "Excel.Sheet"
for n=1 to objs.count do(
cell_prev = xl.application.cells n 1 --get the cell A1
cell_name = xl.application.cells n 2 --get the cell B1
-- make the preview of current object, i have a function to do it
pastedImg = object render as a bitmap
cell_prev.value = pastedImg
cell_name.value = objs[n].name
)--end loop on array
-- save the xls file to a filename string like @"c:\obj_list.xls"
??????????
-- close the xls file
releaseOLEObject xl
Thanks for your advices
I'm searching a way to create, write and save via maxscript a excel (.xls) file. I know that i can open excel file via OLEobject but i don't know how to format and save it.
For example, i want to create a contactsheet of all objects in a scene
for each xls line --> put the preview (.jpg file) and the name of current object.
So cell A1= preview, cell B1= string name... and so on for each object.
I can't find documentation on how to format data for .xls filetype.
And, is there a way to put in excel (maybe via clipboard) a rendered image ?
xl = createOLEObject "Excel.Sheet"
for n=1 to objs.count do(
cell_prev = xl.application.cells n 1 --get the cell A1
cell_name = xl.application.cells n 2 --get the cell B1
-- make the preview of current object, i have a function to do it
pastedImg = object render as a bitmap
cell_prev.value = pastedImg
cell_name.value = objs[n].name
)--end loop on array
-- save the xls file to a filename string like @"c:\obj_list.xls"
??????????
-- close the xls file
releaseOLEObject xl
Thanks for your advices
