View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_4_] Dave Peterson[_4_] is offline
external usenet poster
 
Posts: 52
Default Dealing with pop-ups

The easier questions first.

Surrounding your code with
application.displayalerts = false
'your code here
application.displayalerts = true

can stop a lot of those pop up messages--like you get when you save or unshare a
workbook:

'share it
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\My Documents\excel\book2.xls", _
AccessMode:=xlShared
Application.DisplayAlerts = True


'unshare it
Application.DisplayAlerts = False
ActiveWorkbook.ExclusiveAccess
Application.DisplayAlerts = True



The links question:

You can toggle the setting (user by user, though) via:

Tools|Options|Edit Tab.
There's a checkmark for "ask to update automatic links"

But this means that you suppress the question--the links still get updated.

This setting is for the individual user--and affects all their workbooks.

If you want more control:
Try creating a dummy workbook whose only purpose is to open the original
workbook with links updated:

Kind of like:

Option Explicit
Sub auto_open()
Workbooks.Open Filename:="c:\my documents\excel\book2.xls", UpdateLinks:=1
ThisWorkbook.Close savechanges:=False
End Sub

Then you open the dummy workbook and the links will be refreshed.

And xl2002 added an option that allows you to have more control:
Edit|links|startup prompt button.
check the "don't display the alert and update links"



Jasons wrote:

I wrote some code in VBA in order to make a excel form available for
multiple data entry (share workbook). As the spreadsheet has some
linked data field, when people open it, it always ask for whether to
update all links.

Can VBA automate this ?

Also, I use some code to save the workbook and the workbook thus always
ask users whether s/he want to save as a new name or replace the old
file with the same name.

Can VBA automate this as well?

When I try to use the VBA code to make a shared workbook into exclusive
use, it always ask user for confirmation by a pop-up (ask for yes or
no).

Can VBA automate this ?

Thanks a LOT....

Jasons

--
Jasons
------------------------------------------------------------------------
Jasons's Profile: http://www.excelforum.com/member.php...o&userid=16108
View this thread: http://www.excelforum.com/showthread...hreadid=276028


--

Dave Peterson