Excel External Data Connection crashing on other users -


i have tool.xlsx file uses external data connection access db (both on network drive, available users proper access rights). have vbscript (code below) refreshes connections in workbook. works charm when running script when colleague runs it, throws no errors not connections refreshed. ideas?

dim xlapp dim xlwkb set xlapp = createobject("excel.application") xlapp.visible = false xlapp.workbooks.open "\\networkpath\tool.xlsx" xlapp.displayalerts = false set wr = xlapp.workbooks.open("\\networkpath\tool.xlsx") wr.refreshall xlapp.visible = false wr.save wr.close 

and here connection string tool.xlsx workbook:

provider=microsoft.ace.oledb.12.0;user id=admin;data source=\\networkpath\db.accdb;mode=share deny write;extended properties="";jet oledb:system database="";jet oledb:registry path="";jet oledb:engine type=6;jet oledb:database locking mode=0;jet oledb:global partial bulk ops=2;jet oledb:global bulk transactions=1;jet oledb:new database password="";jet oledb:create system database=false;jet oledb:encrypt database=false;jet oledb:don't copy locale on compact=false;jet oledb:compact without replica repair=false;jet oledb:sfp=false;jet oledb:support complex data=false;jet oledb:bypass userinfo validation=false;jet oledb:limited db caching=false;jet oledb:bypass choicefield validation=false 

here's different approach @ refreshing each connection @ once:

on error resume next dim xlapp dim xlwkb set xlapp = createobject("excel.application") xlapp.visible = false xlapp.displayalerts = false set wr = xlapp.workbooks.open("\\networkpath\tool.xlsx")     each cn in wr.connections         cn.refresh     next wr.refreshall xlapp.visible = false wr.save wr.close 


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -