Archivi categoria: windows

Contributions to Mageia – April 2018

ActivitiesAs I’m back to work on some package for Mageia… let’s resume from where we stopped also on this blog.


  • areca-backup 7.5

areca-backup wasn’t properly working starting from Mageia 5 because of its dependency to Java (proprietary).

Consider also that areca-backup seems no longer maintained upstream (last version released on August, 26th 2015)  but there are still users that, like me, need that tool to backup/restore important data.

It was thus necessary to make it work with openjdk, with our current version of GTK and so on: that’s why I made a few patches to be able to make it fully functional again ?

  • davmail 4.8.5 (latest version)

The new version is now available in Cauldron.

davmail is awesome when you have to interface your thunderbird to and Exchange Server made available through EWS.

That’s all. See you next month and… thanks for reading


Excel VBA – How it can speed up your work and ruin your reputation

The Hell of multiple instances and why you should really avoid to use it in production

(about) Five months have passed since my last post and now I’m back again to tell you a story I’ve gone through: this one particularly tells of Excel VBA invoking Outlook passing through multiple instances of EXCEL32*.

During the last two years I massively used Excel, PowerPoint and Outlook empowered by VBA during my daylife job: Excel VBA is really good when it comes to play with business data & market analytics or when you need to automate repetitive and time-consuming tasks. Outlook is the client that perfectly integrates to the MS Office suite and to the authentication platform in use.

Everything was going smoothly with Workbooks, Sheets, Pivot tables, VBA macros, OLAP queries and so on until the day it was decided to use Excel VBA to automate some reporting to the Managers by

  • downloading data from an Internet Explorer 8 session
  • placing something inside a temporary sheet used to do the dirty job
  • sending every table and similar as images inside the body of an e-mail, not as attachments.

Well,  even if it could sound extremely insane -imho it definitely is- apparently good reasons exists.

I started writing down some ideas, focusing on

  • Reusability of the code
  • Regular Expressions (provided by Microsoft VBScript Regular Expression 5.5) to parse data coming from IE8
  • Automation of Outlook using VBA and  MAPI
  • HTML messages to easily play with images built on-the-fly and attached to the email message, i.e. somehow referenced/embedded inside the HTML message
  • Configurable behavior (a Sheet or an external plain text file containing parameters)

A couple of days should have been dedicated to the study and the development but it came that “as there’s no time to spend on software development it’s safe to use “simpler” solutions” like a dirty macro doing something like

  • coping the needed tables and graphical objects as images inside the Windows clipboard (using something like Selection.CopyPicture Appearance:=xlScreen, Format:=xlBitmap )
  • pasting from the clipboard inside the new outlook mail message using key combinations (kind of Application.SendKeys “^v”  )



This approach –even if awful– properly works when you run your macro one shot avoiding at the same time any kind of interaction during the execution but, what happens when you need to run multiple instances of VBA Macros simultaneously?

The problem is not Excel by itself, of course but, abusing the clipboard and the SendKeys API could lead to a huge number of problems that will impact your work and your reputation after all.

It briefly comes that running two different process of EXCEL32 with two different macros – both interacting with Outlook and the Windows clipboard – led to something catastrophic where

  • one of the processes started filling the clipboard with something and immediately get stuck due to a disconnection from the Outlook.Application
  • the other one started pasting corrupted stuff inside the email body or -the worst case- inside the workbook itself and then sending it to the managers 🙁

It came that I could have mitigated those kind of errors by handling things at a lower level, i.e.

  • using Application.CutCopyMode = False and Application.CutCopyMode = True to force a clipboard cleanup a
  • implementing something like a semaphore where if one of the processes was still running/stuck the other should have kept waiting for its turn (maybe never coming) a

[OT] If it would have been granted to access the CSV download page through XMLHttp or better perl-LWP, passing through the proxy authentication NTLMv* it would have been way better.

You know, actually it’s never fault of a computer but, the intrinsic weakness of VBA erupted loudly.

UPDATE 12/30/2015

after the installation of a few system updates and passing from IE8 to Internet Explorer 10 things have gone even worse: outlook new message don’t get the right focus causing Ctrl+V to paste somewhere else, iexplore process brings old sessions back to life -thus multiple tabs- when invoked by the macro.

I miss something very usefull inside VBA:

  • Exception handling capability (Try, Catch, Finally)
  • Easy-to-use classes/tools to access data through proxy, to avoid the IExplorer mess
  • More consistent object model
  • VB Editor/IDE up2date (it’s almost 2016, c’mon)

Se funziona quanto basta, non toccarlo che si guasta

At the very end of this story we managed to make things work properly by running those macros and those processes with computers with a well-defined environement and specific versions of each application involved. o/

ShutDown when I want


Considering that on Windows XP x64 and on all the Vista versions the shutdown executable accepts a delay of 600 seconds only, I’ve written this basic utility using dotNet.
Considerato il fatto che su Windows XP x64 e su Windows Vista l’eseguibile per lo shutdown è stato castrato con un delay massimo di 600 secondi, mi sono scritto questa piccola utility in dotNet per impostare lo spegnimento automatico quando meglio credo (io e non zio Bill).




Ecco una semplice utility – Kiosk Manager – (realizzata in dotNet) atta a semplificare la realizzazione di un chiosco in ambiente windows XP / Vista.
Su Vista ricordatevi di eseguirla con privilegi di amministratore.

Piccolo howto:
* All’avvio viene richiesto subito se si è sicuri di avere avviato l’applicazione con diritti di amministratore.
* La maschera di base contiene i bottoni [Attiva kiosk] [Disattiva/Ripristina] e [About].
* Per iniziare la configurazione del chiosco premete su [Attiva Kiosk] e vi verrà presentata un’ulteriore maschera.
* In questa finestra, intitolata più o meno Choose executable, dovete selezionare, premendo il pulsante [Browse…], l’eseguibile che volete sia eseguito nella vostra postazione/chiosco. Se l’eseguibile necessita di parametri addizionali dovete trascriverli nel box sottostante, appunto Arguments.
* Premendo su [Accept] il gioco è fatto.
* Se dovete tornare alla configurazione di default di windows, premete [Disattiva/Ripristina].

Buon divertimento