Con = "Provider=IBMDA400;Data Source=192.168.2.2;User Id=boss;Password=1we56"
AARRGGHH !! What do you think about?
Here's the deal. No amount of encryption will help you here, because if Excel itself can decrypt the data (and it can, otherwise the connection will never be made), then the malicious type can also do this.
The right way to do this is to ask the user for the user ID and password and use this information to dynamically build the connection string.
Thus, confidential information exists only in the user's head and (temporarily) on the machine that they use (this is probably their machine anyway). It is not in an Excel spreadsheet anywhere that anyone can fall into.
And besides, functional identifiers (shared between different users) are almost always bad ideas as they do an nightmare audit.
source share