Passer de PowerPoint à Excel
Bonjour,
j'ai créer un outil sur Excel permettant plusieurs applications, dont une est de lancer un diaporama d'aide à l'utilisation de cet outil.
Mon problème est que je souhaite par le biais d'un bouton et uniquement par un bouton à fermer power point, ce que j'arrive à faire grâce à ceci :
Code:
1 2 3
| Private Sub CommandButton1_Click()
Application.Quit
End Sub |
et de rappeler mon fichier Excel ce que je n'arrive pas à faire :
Code:
1 2 3 4
| Private Sub CommandButton1_Click()
Windows("Indicateur_TPR_ID.xls").Activate
ActiveSheet.Visible = True
End Sub |
Cette macro ne marche pas où est l'erreur svp ?
Merci pour la réponse.
Gladus :ccool:
Passer de PowerPoint à Excel
Bonjour
Ma question n'est pas résolue
Ma deuxième routine se trouve dans PPT
Gladus :ccool:
Ramener Excel au premier plan
Bonjour,
Citation:
Ma question n'est pas résolue
Peut-être pas si simple, mais on trouve toujours tout sur DvP
A voir selon ton contexte, au niveau « Api-Culture » j’en suis au début, donc je butine
Voir ici :
http://www.developpez.net/forums/d68...d-deja-ouvert/
http://support.microsoft.com/kb/104710/fr
code bouton sur Feuille Excel :
Code:
1 2 3 4 5 6 7 8 9 10 11
| Option Explicit
Private Sub cmdFeuilToPpt_Click()
Dim OBJppt As PowerPoint.Application
Dim objPresent As PowerPoint.Presentation
Set OBJppt = New PowerPoint.Application
OBJppt.Visible = msoTrue
Set objPresent = OBJppt.Presentations.Open("E:\Pass2.ppt")
objPresent.SlideShowSettings.Run
End Sub |
ou bien code bouton dans USF :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| Option Explicit
Private Sub CmdPPT_Click()
Dim OBJppt As PowerPoint.Application
Dim objPresent As PowerPoint.Presentation
Set OBJppt = New PowerPoint.Application
OBJppt.Visible = msoTrue
Set objPresent = OBJppt.Presentations.Open("E:\Pass2.ppt")
Unload Me
objPresent.SlideShowSettings.Run
End Sub |
code bouton sur Slide PPT :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Option Explicit
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function FindWindowByClass Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal NullPointer As Long) As Long
Const SW_RESTORE As Long = 9
Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function IsIconic Lib "user32" (ByVal hWnd As Long) As Long
Private Sub cmdDePptQuit_Click()
Dim hWnd As Long
hWnd = FindWindowByClass("XLMain", 0)
If hWnd Then
If IsIconic(hWnd) Then
ShowWindow hWnd, SW_RESTORE
End If
SetForegroundWindow hWnd
End If
Application.Quit
End Sub |
cordialement,
Didier