[Excel-VBA]

Pkoi -  
 Pkoi -
Bonjour,

Je rencontre un problème avec une macro que j'ai trouve sur internet afin de télécharger un fichiers via son url.

Le programme est le suivant:

Option Explicit

Declare Function DoFileDownload Lib "shdocvw.dll" (ByVal lpszFile As String) As Long

Sub DownLoadFile()
Dim sUrl As String

sUrl = StrConv(InputBox("URL du fichier à télécharger ?", "téléchargement", vbNullString), vbUnicode)
DoFileDownload sUrl
End Sub

Lors du lancement de la macro avec l'url d'un fichier .xls, un textbox s'affiche je clique sur OK et le message suivant s'affiche :

your security settings do not allow this file to be downloaded

J'ai essayé:

- de mettre la securité des macros au plus bas.
- de désactiver le firewall.
- de mettre la sécurité de ie (mon navigateur par défaut) au plus bas.
- de télécharger un autre fichier

Rien y fait.

Que dois-je faire ? Des idées ?
Merci d'avanceConfiguration: Windows XP
Internet Explorer 7.0
Configuration: Windows XP
Internet Explorer 7.0

1 réponse

  1. manirac Messages postés 37 Date d'inscription   Statut Membre 6
     
    J'ai trouvé ça à cette URL : http://www.zeropaid.com/bbs/archive/index.php/t-30253.html

    do this via internet explorer
    this will resolve your problem.
    click on tools
    click on internet options
    click on security
    click on custom level
    scroll down till you get to downloads in the security section
    click and enable automatic prompting for downloads
    click and enable file download
    simple as that click ok and it will work


    J'espère que tu lis l'anglais !
    -1
    1. Pkoi
       
      Merci manirac,

      C'est très sympa de m'aider mais j'ai fini par trouver. En réalité dans le textbox il fallait mettre l'adresse une nouvelle fois.

      La bonne macro est la suivante:

      Declare Function DoFileDownload Lib "shdocvw.dll" (ByVal lpszFile As String) As Long

      Sub telecharge()

      Dim sUrl As String

      sUrl = StrConv(InputBox("URL du fichier à télécharger ?", "téléchargement", "URL du fichier à télécharger ?"), vbUnicode)

      DoFileDownload sUrl

      End Sub

      Merci encore
      0