How can i get the value of the AsktoUpdatelinks form ??

S

stakar

Hi!
I have a problem
I have the following code
-----------------------------------------------------
Private Sub Workbook_Open()

'Dim active_wb As String
'active_wb = ActiveWorkbook.FullName

Application.ScreenUpdating = False

'If Workbooks.Application(Filename:=active_wb, UpdateLinks:=3) Then
'ThisWorkbook.Close savechanges:=False
Call Kontres_Update
'End If

Worksheets("SH").Activate
Application.Goto reference:="R4C9"
Application.ScreenUpdating = True

End Sub
--------------------------------------------------------
When i open the workbook i want to have the value of th
'asktoupdatelinks' because it depends on the call Kontres_Update.

In other words if i click on 'No' on the 'asktoupdatelinks' form i don
want to call the macro 'Kontres_Update', but when i click on 'Yes' t
call it.
I tried, as you can see, something but it asks me if i want to sav
changes because the workbook is already open

Thanks in advance
Stathi
 
T

Tom Ogilvy

The updatelinks dialog is shown before any macros are run. To the best of
my knowledge, you can not determine what the user has answer except perhaps
by checking what the values of linked cells might be and I would be hard
pressed to come up with a reliable way to do that.
 
S

stakar

So, Tom
Theres a way not to showing the updatelinks dialogue but to be a
default the 'Yes' Option ?
Because my problem is the 'No' option but if the user always check th
'Yes' option it wouldnt be any problem at all!!

Thanks
Stathis
 
T

Tom Ogilvy

there is an application level setting under Tools=>Options=>Edit tab. (ask
to update automatic links).

however, you have no control over this setting with code in the workbook
being opened. the query will be performed before any code is run.

If you want the links updated, then in the workbook_open event, put in code
to update the links. If the user doesn't disable macros, then your code
would update the links. Other than that, I guess you would have to put up a
message box and ask the user if links were updated.
 
S

stakar

Thanks Tom
I ll do the second suggestion
I ll put a message box to ask the user if the links are updated so t t
update the links by his own!!

Thanks for the replies
Stathis

Tom said:
*there is an application level setting under Tools=>Options=>Edi
tab. (ask
to update automatic links).

however, you have no control over this setting with code in th
workbook
being opened. the query will be performed before any code is run.

If you want the links updated, then in the workbook_open event, pu
in code
to update the links. If the user doesn't disable macros, then you
code
would update the links. Other than that, I guess you would have t
put up a
message box and ask the user if links were updated.

--
Regards,
Tom Ogilvy


stakar > said:
So, Tom
Theres a way not to showing the updatelinks dialogue but to be as
default the 'Yes' Option ?
Because my problem is the 'No' option but if the user always chec the
'Yes' option it wouldnt be any problem at all!!

Thanks
Stathis


 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top