Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Equivalent scrennupadating

5 réponses
Avatar
snake1984
Bonjour a tous.

Je voudrais savoir si il existe en vba powerpoint un équivalent du
application.sceenupdating du vba excel?

Si il n'existe pas est ce que quelqu'un connait un manière de faire un
raffraichissement de l'écran?

D'avance merci

5 réponses

Avatar
Nikita
Salut,

tout fait pour toi :
http://skp.mvps.org/ppt00033.htm

Niki


Bonjour a tous.

Je voudrais savoir si il existe en vba powerpoint un équivalent du
application.sceenupdating du vba excel?

Si il n'existe pas est ce que quelqu'un connait un manière de faire un
raffraichissement de l'écran?

D'avance merci


Avatar
snake1984
Merci nikita

J'avais déja trouvé cette macro mais j'ai ouvlié de préciser que j'étais en
VB.NET. Je suis en train d'essayé de l'adapter mais comme je suis débutant....

Merci


Salut,

tout fait pour toi :
http://skp.mvps.org/ppt00033.htm

Niki


Bonjour a tous.

Je voudrais savoir si il existe en vba powerpoint un équivalent du
application.sceenupdating du vba excel?

Si il n'existe pas est ce que quelqu'un connait un manière de faire un
raffraichissement de l'écran?

D'avance merci







Avatar
snake1984
J'ai modifier le scipt que tu ma donné de la manière suivante :

' UserDefined Error codes
Const ERR_NO_WINDOW_HANDLE As Long = 1000
Const ERR_WINDOW_LOCK_FAIL As Long = 1001
Const ERR_VERSION_NOT_SUPPORTED As Long = 1002


' API declarations for FindWindow() & LockWindowUpdate()
' Use FindWindow API to locate the PowerPoint handle.

Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As Long) As Long

' Use LockWindowUpdate to prevent/enable window refresh
Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long)
As Long

' Use UpdateWindow to force a refresh of the PowerPoint window
Declare Function UpdateWindow Lib "user32" (ByVal hwnd As Long) As Long

Property screenupdating() As Boolean '(ByVal state As Boolean) As Boolean
Get
'screenupdating = value
End Get
Set(ByVal value As Boolean)
Static hwnd As Long
Dim VersionNo As String


' Get Version Number

If value = False Then

VersionNo = Left(appPpt.Version, _
InStr(1, appPpt.Version, ".") - 1)



' Get handle to the main application window using ClassName

Select Case VersionNo
Case "8" ' For PPT97:

hwnd = FindWindow("PP97FrameClass", 0&)
Case "9" ' For PPT2K:

hwnd = FindWindow("PP9FrameClass", 0&)

Case "10" ' For XP:
hwnd = FindWindow("PP10FrameClass", 0&)

Case "11" ' For 2003:
hwnd = FindWindow("PP11FrameClass", 0&)

Case Else
Err.Raise(Number:=vbObjectError +
ERR_VERSION_NOT_SUPPORTED, _
Description:="Supported for PowerPoint
97/2000/2002/2003 only.")
Exit Property
End Select

If hwnd = 0 Then
Err.Raise(Number:=vbObjectError + ERR_NO_WINDOW_HANDLE, _
Description:="Unable to get the PowerPoint Window handle")
Exit Property
End If

If LockWindowUpdate(hwnd) = 0 Then
Err.Raise(Number:=vbObjectError + ERR_WINDOW_LOCK_FAIL, _
Description:="Unable to set a PowerPoint window lock")
Exit Property
End If

Else

' Unlock the Window to refresh

LockWindowUpdate(0&)

UpdateWindow(hwnd)
hwnd = 0

End If
End Set
End Property

Le problème est que lorsque je lance mon programme j'ai une erreur
"Un appel à la fonction PInvoke
'OfficeMap!OfficeMap.Forme::LockWindowUpdate' a déséquilibré la pile. Cela
peut se produire, car la signature PInvoke managée ne correspond pas à la
signature cible non managée. Vérifiez que la convention d'appel et les
paramètres de la signature PInvoke correspondent à la signature non managée
cible." à la ligne LockWindowUpdate(0&)

Et je ne vois pas pourquoi.

Merci d'avance
Avatar
Dom
Bonjour,

Je ne sais pas où tu vas avec ce code, mais es-tu sûr qu'il n'y a pas
d'autres moyens de rafraîchir l'affichage d'une diapo que de passer par du VB
net ou pas ?
Si le screenupadting n'est pas dans le vba PPT, c'est que son utilité ne
crève pas les yeux.

Le code est donné pour les versions 97 à 2003, mais pas 2007 (au cas où ce
serait la version que tu utilises). Tu peux déjà virer les lignes des
versions que tu n'utilises pas (sauf si tu ne connais pas la destination).
Mais pour ton erreur, demande peut-être sur le forum
microsoft.public.fr.dotnet.vb ou à l'auteur du code.

Dom



J'ai modifier le scipt que tu ma donné de la manière suivante :

' UserDefined Error codes
Const ERR_NO_WINDOW_HANDLE As Long = 1000
Const ERR_WINDOW_LOCK_FAIL As Long = 1001
Const ERR_VERSION_NOT_SUPPORTED As Long = 1002


' API declarations for FindWindow() & LockWindowUpdate()
' Use FindWindow API to locate the PowerPoint handle.

Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As Long) As Long

' Use LockWindowUpdate to prevent/enable window refresh
Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long)
As Long

' Use UpdateWindow to force a refresh of the PowerPoint window
Declare Function UpdateWindow Lib "user32" (ByVal hwnd As Long) As Long

Property screenupdating() As Boolean '(ByVal state As Boolean) As Boolean
Get
'screenupdating = value
End Get
Set(ByVal value As Boolean)
Static hwnd As Long
Dim VersionNo As String


' Get Version Number

If value = False Then

VersionNo = Left(appPpt.Version, _
InStr(1, appPpt.Version, ".") - 1)



' Get handle to the main application window using ClassName

Select Case VersionNo
Case "8" ' For PPT97:

hwnd = FindWindow("PP97FrameClass", 0&)
Case "9" ' For PPT2K:

hwnd = FindWindow("PP9FrameClass", 0&)

Case "10" ' For XP:
hwnd = FindWindow("PP10FrameClass", 0&)

Case "11" ' For 2003:
hwnd = FindWindow("PP11FrameClass", 0&)

Case Else
Err.Raise(Number:=vbObjectError +
ERR_VERSION_NOT_SUPPORTED, _
Description:="Supported for PowerPoint
97/2000/2002/2003 only.")
Exit Property
End Select

If hwnd = 0 Then
Err.Raise(Number:=vbObjectError + ERR_NO_WINDOW_HANDLE, _
Description:="Unable to get the PowerPoint Window handle")
Exit Property
End If

If LockWindowUpdate(hwnd) = 0 Then
Err.Raise(Number:=vbObjectError + ERR_WINDOW_LOCK_FAIL, _
Description:="Unable to set a PowerPoint window lock")
Exit Property
End If

Else

' Unlock the Window to refresh

LockWindowUpdate(0&)

UpdateWindow(hwnd)
hwnd = 0

End If
End Set
End Property

Le problème est que lorsque je lance mon programme j'ai une erreur
"Un appel à la fonction PInvoke
'OfficeMap!OfficeMap.Forme::LockWindowUpdate' a déséquilibré la pile. Cela
peut se produire, car la signature PInvoke managée ne correspond pas à la
signature cible non managée. Vérifiez que la convention d'appel et les
paramètres de la signature PInvoke correspondent à la signature non managée
cible." à la ligne LockWindowUpdate(0&)

Et je ne vois pas pourquoi.

Merci d'avance


Avatar
snake1984
En fait je suis obligé de passer par du vb.net (exisgence de mon chef)
l'appli sera a terme pour toute les versions c'est pour ca que j'ai laisser
les différentes version. Mais comme cette fonction n'est pas urgente pour
l'instant je vais passer a autre chose et y revenir plus tard

Merci de votre aide


Bonjour,

Je ne sais pas où tu vas avec ce code, mais es-tu sûr qu'il n'y a pas
d'autres moyens de rafraîchir l'affichage d'une diapo que de passer par du VB
net ou pas ?
Si le screenupadting n'est pas dans le vba PPT, c'est que son utilité ne
crève pas les yeux.

Le code est donné pour les versions 97 à 2003, mais pas 2007 (au cas où ce
serait la version que tu utilises). Tu peux déjà virer les lignes des
versions que tu n'utilises pas (sauf si tu ne connais pas la destination).
Mais pour ton erreur, demande peut-être sur le forum
microsoft.public.fr.dotnet.vb ou à l'auteur du code.

Dom



J'ai modifier le scipt que tu ma donné de la manière suivante :

' UserDefined Error codes
Const ERR_NO_WINDOW_HANDLE As Long = 1000
Const ERR_WINDOW_LOCK_FAIL As Long = 1001
Const ERR_VERSION_NOT_SUPPORTED As Long = 1002


' API declarations for FindWindow() & LockWindowUpdate()
' Use FindWindow API to locate the PowerPoint handle.

Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As Long) As Long

' Use LockWindowUpdate to prevent/enable window refresh
Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long)
As Long

' Use UpdateWindow to force a refresh of the PowerPoint window
Declare Function UpdateWindow Lib "user32" (ByVal hwnd As Long) As Long

Property screenupdating() As Boolean '(ByVal state As Boolean) As Boolean
Get
'screenupdating = value
End Get
Set(ByVal value As Boolean)
Static hwnd As Long
Dim VersionNo As String


' Get Version Number

If value = False Then

VersionNo = Left(appPpt.Version, _
InStr(1, appPpt.Version, ".") - 1)



' Get handle to the main application window using ClassName

Select Case VersionNo
Case "8" ' For PPT97:

hwnd = FindWindow("PP97FrameClass", 0&)
Case "9" ' For PPT2K:

hwnd = FindWindow("PP9FrameClass", 0&)

Case "10" ' For XP:
hwnd = FindWindow("PP10FrameClass", 0&)

Case "11" ' For 2003:
hwnd = FindWindow("PP11FrameClass", 0&)

Case Else
Err.Raise(Number:=vbObjectError +
ERR_VERSION_NOT_SUPPORTED, _
Description:="Supported for PowerPoint
97/2000/2002/2003 only.")
Exit Property
End Select

If hwnd = 0 Then
Err.Raise(Number:=vbObjectError + ERR_NO_WINDOW_HANDLE, _
Description:="Unable to get the PowerPoint Window handle")
Exit Property
End If

If LockWindowUpdate(hwnd) = 0 Then
Err.Raise(Number:=vbObjectError + ERR_WINDOW_LOCK_FAIL, _
Description:="Unable to set a PowerPoint window lock")
Exit Property
End If

Else

' Unlock the Window to refresh

LockWindowUpdate(0&)

UpdateWindow(hwnd)
hwnd = 0

End If
End Set
End Property

Le problème est que lorsque je lance mon programme j'ai une erreur
"Un appel à la fonction PInvoke
'OfficeMap!OfficeMap.Forme::LockWindowUpdate' a déséquilibré la pile. Cela
peut se produire, car la signature PInvoke managée ne correspond pas à la
signature cible non managée. Vérifiez que la convention d'appel et les
paramètres de la signature PInvoke correspondent à la signature non managée
cible." à la ligne LockWindowUpdate(0&)

Et je ne vois pas pourquoi.

Merci d'avance