denis.1983
00mercoledì 4 marzo 2020 10:50
salve sono nuovo del forum, ho un problema su un file che deve essere fruito da versioni a 32 bit e 64 bit, ho recuperato in rete qualche discussione ma non ne esco
Fondamentalmente voglio aprire/stampare (cambio funzione Open/Print) dei disegni pdf da una selezione di celle. A 32 bit tutto ok
qualcuno mi può dare un suggerimento sulle dichiarazioni?
**pezza trovata in rete - NON FUNZIONANTE ***
Private Declare PtrSafe Function FindWindow Lib "USER32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
***script ok in 32 bit****
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 PrintFile(PercorsoFile As String)
On Error GoTo esci
Call ShellExecute(0, "Print", PercorsoFile, "", "", 0)
Exit Sub
esci:
End Sub
Sub stampa_files()
Dim PercorsoFile As String
For Each CELLA In Selection
PercorsoFile = CELLA.Value
Call PrintFile(PercorsoFile)
Next
End Sub
dodo47
10mercoledì 4 marzo 2020 12:00
ciao
prova:
#If VBA7 Then
Private Declare PtrSafe 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
#Else
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
#End If
TuaSub()
.....
saluti
denis.1983
00mercoledì 4 marzo 2020 14:37
Re:
YES, funziona
grazie infinite!! e che velocità!
complimenti