Sorry for the intrusion
IMHO, this is a job for Python, Openpyxl and Pandas
MS Office is not required, just create the xlsx directly.
import traceback
from pyrx_imp import Rx
from pyrx_imp import Ge
from pyrx_imp import Gi
from pyrx_imp import Db
from pyrx_imp import Ap
from pyrx_imp import Ed
import pandas as pd
#get the attribues and return them as a list
def getAttValues(ref: Db.BlockReference)->list[str]:
v = []
for attrefid in ref.attributeIds():
attref = Db.AttributeReference(attrefid)
match attref.tag():
case 'SL':
v.append(attref.textString())
case 'LOAD':
v.append(attref.textString())
case 'QTY':
v.append(attref.textString())
case _:
pass
return v
def PyRxCmd_doit():
try:
db = Db.curDb()
#define our columns
data = {'SL#': [],
'Unit Weight': [],
'QTY': [],
'Total KG': [],}
#search for blocks 'MACHINE WEIGHT'
bt = Db.BlockTable(db.blockTableId())
spkIds = [id for (n, id) in bt.toDict().items() if n == 'MACHINE WEIGHT']
for id in spkIds:
btr = Db.BlockTableRecord(id)
for refid in btr.getBlockReferenceIds():
ref = Db.BlockReference(refid)
values = getAttValues(ref)
#pandas wants equal length lists
if len(values) != 3:
continue
data['SL#'].append(values[0])
data['Unit Weight'].append(values[1])
data['QTY'].append(values[2])
total = float( float(values[1]) * float(values[2]))
data['Total KG'].append(total)
df = pd.DataFrame(data)
df.loc['total']= df.sum(numeric_only=True)
#write to excel
with pd.ExcelWriter('e:\\pandas_to_excel.xlsx') as writer:
df.to_excel(writer, sheet_name='sheet1',index=False)
except Exception as err:
traceback.print_exception(err)

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx