COMANDO SHELL NAO FUNCIONA NO CLIENTE

LANCECOM 28/10/2009 10:51:08
#326429
Interessante que em minha maquina funciona

Private Sub nfeM_Click()
Dim RetVal As Integer
Dim i, v as integer
Dim pp As String
pp = App.Path & [Ô]\NFe-SIGO.exe[Ô]
DoEvents
i = Shell(pp, 1)
v = DoEvents()
End Sub

Mas no cliente simplesmente fecha a aplicação, ...
Mas fiz um form1 limpo com esta rotina, e da a mensagem [Ô]Invalid procedure call argument[Ô], (tudo isso no cliente)
Imagino que seja alguma configuração da maquina do cliente, mas não sei onde procurar isso la
Alguem ja passou por isso
Obrigado
PAYDANA 29/10/2009 20:01:20
#326540
i = Shell(App, 1)
ICEMAN 01/11/2009 09:24:18
#326676
Resposta escolhida
Citação:

LANCECOM escreveu:
Interessante que em minha maquina funciona

Private Sub nfeM_Click()
Dim RetVal As Integer
Dim i, v as integer
Dim pp As String
pp = App.Path & [Ô]NFe-SIGO.exe[Ô]
DoEvents
i = Shell(pp, 1)
v = DoEvents()
End Sub

Mas no cliente simplesmente fecha a aplicação, ...
Mas fiz um form1 limpo com esta rotina, e da a mensagem [Ô]Invalid procedure call argument[Ô], (tudo isso no cliente)
Imagino que seja alguma configuração da maquina do cliente, mas não sei onde procurar isso la
Alguem ja passou por isso
Obrigado



bom acredito que se vc fizer um tratamento funcione olha como eu faria

[ô]No general
Option Explicit

Private Declare Function ShellExecute Lib [Ô]shell32.dll[Ô] Alias [Ô]ShellExecuteA[Ô] _
(ByVal hwnd As Long, _
ByVal lpszOp As String, _
ByVal lpszFile As String, _
ByVal lpszParams As String, _
ByVal lpszDir As String, _
ByVal FsShowCmd As Long) As Long

Private Declare Function GetDesktopWindow Lib [Ô]user32[Ô] () As Long

Const SW_SHOWNORMAL = 1

Const SE_ERR_FNF = 2&
Const SE_ERR_PNF = 3&
Const SE_ERR_ACCESSDENIED = 5&
Const SE_ERR_OOM = 8&
Const SE_ERR_DLLNOTFOUND = 32&
Const SE_ERR_SHARE = 26&
Const SE_ERR_ASSOCINCOMPLETE = 27&
Const SE_ERR_DDETIMEOUT = 28&
Const SE_ERR_DDEFAIL = 29&
Const SE_ERR_DDEBUSY = 30&
Const SE_ERR_NOASSOC = 31&
Const ERROR_BAD_FORMAT = 11&

Private Sub nfeM_Click()
Dim RetVal As Integer
Dim i, v as integer
Dim pp As String
pp = App.Path [ô]& [Ô]\NFe-SIGO.exe[Ô]

if right(pp,1)=[Ô]\[Ô] then pp=mid(pp,1,len(pp) - (1))
[ô]duas vezes pra ter certeza
if right(pp,1)=[Ô]\[Ô] then pp=mid(pp,1,len(pp) - (1))

pp=pp & [Ô]\[Ô]

DoEvents
ShellExecute(Scr_hDC, [Ô]Open[Ô], [Ô]NFE-Sigo.exe[Ô], _
[Ô][Ô], pp,SW_SHOWNORMAL)
DoEvents()
End Sub
LANCECOM 17/06/2010 12:35:20
#345104
ICEMAN
Desculpas ai, meio que atrasado... tinha esquecido deste topico, valeu seu post
Muito obrigado pela atenção
Tópico encerrado , respostas não são mais permitidas