|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Member
Iscritto dal: Feb 2001
Città: Reggio Emilia
Messaggi: 230
|
FIND WINDOWS IN XP
Perchè in XP Find Windows non funzia?
Questo codice sotto 98 funziona correttamente Codice:
Private Declare Function FindWindow Lib "user32" Alias _ "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Sub excel() Dim path Dim hwnd As Long path = (directory di CAMBI.xls) hwnd = FindWindow(vbNullString, "Microsoft Excel - CAMBI.xls") If hwnd = 0 Then ' 0 significa che il file di Excel non è in esecuzione. ShellExecute hwnd, vbNullString, path, vbNullString, vbNullString, 0 Else Exit Sub End If End Sub |
|
|
|
|
|
#2 |
|
Member
Iscritto dal: Feb 2001
Città: Reggio Emilia
Messaggi: 230
|
aiutoo
Devo risolvere questo problema, perchè non riesco a far girare il mio codice sotto XP |
|
|
|
|
|
#3 | |
|
Junior Member
Iscritto dal: Jan 2003
Messaggi: 1
|
Così Funziona in XP
Quote:
Codice:
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Sub excel()
Dim path
Dim hwnd As Long
path = "C\Documents and Settings\Aretiz\Documenti\CAMBI.xls"
hwnd = FindWindow(vbNullString, "Microsoft Excel - CAMBI.xls")
If hwnd = 0 Then ' 0 significa che il file di Excel non è in esecuzione.
ShellExecute hwnd, vbNullString, path, vbNullString, vbNullString, 0
Else
Exit Sub
End If
End Sub
Private Sub Command1_Click()
Call excel
End Sub
|
|
|
|
|
|
|
#4 |
|
Member
Iscritto dal: Feb 2001
Città: Reggio Emilia
Messaggi: 230
|
Tutto OK
Grazie |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 20:41.


















