Unshare an Excel sheet with VB.Net

  • Thread starter Thread starter Erik Foreman
  • Start date Start date
E

Erik Foreman

I use the line

XLwkb.ExclusiveAccess()

to unshare the workbook and it works. the problem is it sends up a
prompt for confirmation. When I run this there will be noone around to
confirm it. how do we unshare the workbook without being prompted to
confirm.

I tried
XLwkb.ExclusiveAccess() = True
and that did not work.
I tried
XLwkb.ExclusiveAccess(True)
and
XLwkb.ExclusiveAccess(1)
both those said invalid number of parameters.
 
¤ I use the line
¤
¤ XLwkb.ExclusiveAccess()
¤
¤ to unshare the workbook and it works. the problem is it sends up a
¤ prompt for confirmation. When I run this there will be noone around to
¤ confirm it. how do we unshare the workbook without being prompted to
¤ confirm.
¤
¤ I tried
¤ XLwkb.ExclusiveAccess() = True
¤ and that did not work.
¤ I tried
¤ XLwkb.ExclusiveAccess(True)
¤ and
¤ XLwkb.ExclusiveAccess(1)
¤ both those said invalid number of parameters.
¤

Try changing the DisplayAlerts property of the Application object to False. Just remember to set it
back to True when finished.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Back
Top