![]() |
|
Forum
|
|
|||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 (permalink) |
|
XLDnaute Occasionel
Date d'inscription: avril 2006
Messages: 215
|
Bonjour à toutes et à tous
Volià mon pb. J'ai un classeur excel sous internet explorer (il s'agit de l'intranet du boulôt) dans laquel j'ai rajouté une macro qui permet d'aller chercher des infos dans un fichier excel situé dans mes documents et de coller ces infos sur une feuille de mon classeur excel sous IE. J'ai une erreur 1004 à workbooks.open (Le Fichier) Mais ce qui est étonnant c'est que si j'ouvre l'éditeur vba et que je lance la macro pas à pas et bien pas de pb, la macro fonctionne. J'en perd mon latin et comme mes connaissances en vba sont qd même limitées, je sèche ! PS: Ce post fait suite à un autre message posté sous l'intitulé Pb getopenfilename. Post un peu confus. J'ai donc souhaité remettre tout à plat !! ![]() ci-joint le code vba ----------------------------------------------------------------------------------------- Sub test() Dim deb As Long Dim fin As Long Dim moi As String moi = ActiveWorkbook.Name Dim LeFichier as string Dim LeNom$ LeFichier = Application.GetOpenFilename(" Fichiers excel (*.xls),*.xls") If LeFichier = False Then MsgBox "Importation abandonnée!" Exit Sub Else Workbooks.Open (LeFichier) End If deb = InputBox("Ligne de debut ?") fin = InputBox("Ligne de fin ?") LeNom = ActiveWorkbook.Name ActiveWorkbook.ActiveSheet.Range("A" & deb & ":F" & fin).Copy Destination:=Workbooks(moi).Sheets("Import").Range ("A65536").End(xlUp).Offset(1, 0) Workbooks(LeNom).Close Sheets("Import").Select End Sub Dernière modification par antiphot ; 26/10/2007 à 23h56. |
|
|
|
![]() |
| Liens sociaux |
| Outils de la discussion | |
|
|
Discussions similaires
|
||||
| Discussion | Auteur | Forum | Réponses | Dernier message |
| Créer fichier txt à partir d'un fichier excel | Kristof | Forum Excel | 6 | 22/08/2007 14h15 |
| Ouvrir un fichier excel à partir d'un autre fichie | Cybher | Forum Excel | 10 | 31/03/2005 22h50 |
| envoyer les infos d'un userform ds 1 autre fichier excel. | duc | Forum Excel Downloads - Archives | 0 | 26/02/2004 17h04 |
| modifier fichier excel à partir d'un autre fichier | nicolas | Forum Excel Downloads - Archives | 2 | 13/08/2003 18h12 |
| Création d'un fichier Excel à partir d'une autre page Excel | NonO51 | Forum Excel Downloads - Archives | 0 | 27/01/2003 17h47 |