Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Hyperlinks in Macro

  Asked By: Dukker    Date: Dec 08    Category: MS Office    Views: 766
  

I hope someone can help me on this. I am creating an excel macro that
when I click a button, it will open a file from a web (I have already
done this). My problem is, when I click the button, a display alert
pops-up before I can open the link. It says :

"Some files can contain viruses or otherwiese be harmful to your
computer. It is important to be certain that this file is from a
trustworthy source.
Would you like to open this file?" <ok> <Cancel>

I want the link to open automatically without answering any questions. I
tried to insert the command "Application.DisplayAlerts = False" but it
didn't work. Does anyone have an idea?

Share: 

 

6 Answers Found

 
Answer #1    Answered By: Aran Boonliang     Answered On: Dec 08

You cannot control security from VBA. If you think about it this is A GOOD
THING!

The user could set their internet security level to low. This is done from IE
in tools, options, security. There are many settings you can adjust and I am
not sure if this is one that can be adjusted individually. The problem  is
that setting it to low does make the computer more vulnerable to virus attack.

If the file  has macros in it, the creator can digitally sign it and install
the certificate on the user's computer. Details of how to do this are on the
website http://www.mousetrax.com/techtrax. I am not sure quite where. There
was a discussion of this recently on, I think, the Word VBA list.

 
Answer #2    Answered By: Vickie Smith     Answered On: Dec 08

Yes, I agree that internet security is a good thing. But I am opening
from a trusted web  (from our company's intranet).

 
Answer #3    Answered By: Lois Schmidt     Answered On: Dec 08

Here is some code

Sub test()

Dim webBk As Workbook
Set webBk = Workbooks.Open("http://www.nseindia.com/content/fo/fii_stats.xls")

End Sub

Tie this code to a button  and you are thru.

 
Answer #4    Answered By: Abaigael Cohen     Answered On: Dec 08


The code works but I think I have another problem. The data from the
website is being updated everyday so I need to get the data everyday
(using the macro  I am developing). I think the second time I use the
macro, the data is not taken from the web  but from my computer's cache
(temporary internet files). Do you also have an idea  how to get the data
from the web instead of getting it from my cache without me deleting my
temporary internet files?

 
Answer #5    Answered By: Abella Martin     Answered On: Dec 08

I am sorry, I should have given you the full code. You basically have to clear
the clipboard of all info and close the wrokbook after you have extracted
whatever info you want from it. This is just an additional line.

Dim WebBk As Workbook
Set WebBk = Workbooks.Open("http://www.nseindia.com/content/fo/fii_stats.xls")

'''''''Apply your code here'''''''

Application.Cutcopymode = False 'Clear clipboard
WebBk.Close

I hope this helps.

 
Answer #6    Answered By: Michelle Clark     Answered On: Dec 08

It's not always getting the data in the web. Sometimes it still gets the
data from my cache. Anyway, I can live with it.

 
Didn't find what you were looking for? Find more on Hyperlinks in Macro Or get search suggestion and latest updates.




Tagged: