Hi again Vincent. In the last email was missing the way the code looks now (I am updating it cos now the ses computation result is recovered on a different way), see the var mysesoutput. --8<---------------cut here---------------start------------->8--- ;;; with a buffer visiting the file /tmp/smeteroutput (output of smeterApp) run this function (defun smeter/further-processing () "process input on as spreadsheet using ses formulae and extracting the ses computation result" (interactive) (let ( (sesbuf nil) (measu nil) (prevmeasu '()) (waterbill nil) (beg nil) (workbook-filename) myyyyymm mysesoutput) (goto-char (point-min)) (setq beg (point)) (setq workbook-filename (buffer-substring-no-properties beg (line-end-position))) (forward-line 1) (setq beg (point)) (forward-line 4) (setq prevmeasu (split-string (buffer-substring-no-properties beg (point)) "\n")) (setq beg (point)) (setq waterbill (buffer-substring-no-properties beg (line-end-position))) (forward-line 1) (setq beg (point)) (forward-line 4) (setq measu (buffer-substring-no-properties beg (point))) (setq beg (point)) (setq myyyyymm (buffer-substring-no-properties beg (line-end-position))) (if (not (file-readable-p workbook-filename)) (message (format "file not found: '%s'" workbook-filename)) (set-buffer (setq sesbuf (find-file-noselect workbook-filename))) (ses-set-cell 12 2 'value (string-to-number waterbill)) ;;; C13 (ses-set-cell 2 1 'value (string-to-number (nth 0 prevmeasu))) ;;; B3 (ses-set-cell 3 1 'value (string-to-number (nth 1 prevmeasu))) (ses-set-cell 4 1 'value (string-to-number (nth 2 prevmeasu))) (ses-set-cell 5 1 'value (string-to-number (nth 3 prevmeasu))) ;;; B6 ;;; NOTE2ME: yank is needed workaround-one (perhaps cos of deferred calculations) ¿How to call manually the deferred-calculation? (ses-jump-safe "C3") ;;; paste 4 cells (kill-new measu) (yank) ;;; how to get rid of yank? 4 using ses-set-cell in place of yank ;;; (ses-recalculate-all) ;;; NOTE2ME: manual refreshing is needed cos ses-recalculate-all is not doing the job (then workaround-two) ;;; Key:R1 refreshOne cos of measures (all-refreshes-are-workaround-two) ;;; NOTE2ME: It should benefit a lot of persons knowing the right syntax 4 ses-range (let ((minrow 2)(maxrow 5)(mincol 4)(maxcol 5)) (ses-recalculate-cell)) ;;; E3 F6 ;;; Key:R2 refreshTwo cos of waterBill-change (let ((minrow 2)(maxrow 5)(mincol 7)(maxcol 13)) (ses-recalculate-cell)) ;;; H3 N6 ;;; below is for N3 N6 the computation result (setq mysesoutput (concat (number-to-string (ses-cell-value 2 13)) "\n" (number-to-string (ses-cell-value 3 13)) "\n" (number-to-string (ses-cell-value 4 13)) "\n" (number-to-string (ses-cell-value 5 13)))) ;;; kill ses buffer without confirmation (comment 2-lines below for not killing workbook-buffer) (set-buffer-modified-p nil) (let ((kill-buffer-query-functions nil)) (kill-buffer sesbuf)) ;;;(smeter/compose-mail mysesoutput (- (length prevmeasu) 1) myyyyymm) (with-temp-buffer (insert (replace-regexp-in-string "\n" "|" mysesoutput)) (write-file "/tmp/smeter-ses-computation-result-on-one-line")) ;;;(smeter/receipts-amounts) ))) --8<---------------cut here---------------end--------------->8--- Best Regards