Refresh a connection in Excel to SQL Server (with password) using VBA

南笙酒味 提交于 2019-12-06 05:23:45
King_nothing6

There is a way in Excel without VBA:

  1. You can go to Data then Connections
  2. Click Properties on the top Connection
  3. Click the Definition Tab
  4. There is a tick box "Save Password" about half way down, you will get a prompt about the password being stored un-encrypted.
  5. Say yes to this
  6. Click OK

Do the same for all of your connections

You can then refresh all connections and you will be prompted to enter the password for each connection. Once you do this and save the document it will not ask you for your passwords again.

You can also tick "Refresh data when opening the file" on the Usage tab to have the connections refreshed when the workbook is opened.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!