| 
    
     |  | ▼とおりすぎ さん:ありがとうございます >'** Unlha32 API 定義
 >' Public Declare Function Unlha Lib "unlha32" (ByVal hWindows As Long, ByVal CmdLine As String, ByVal Console As String, ByVal size As Long) As Long
 >
 >これを、コメント外して、モジュールの先頭に記述。
 >
 >UNLHA32.DLLがsystem32フォルダなどpathが通っているところにあること。
 >あるいは、"unlha32" をFullNameで記述する。
 
 以下を実行させると「End Sub,End FunctionまたはEnd Property 以降には、コメントのみが記述できます。」のコンパイルエラーが表示されました。
 ご教授下さい。
 
 Sub テスト2()
 '** Unlha32 API 定義
 Public Declare Function Unlha Lib "unlha32" (ByVal hWindows As Long,  ByVal CmdLine As String, ByVal Console As String, ByVal size As Long) As Long
 
 '  Kill ("\\Ls-wtgl469\共通file\特養入居状況.xls")
 If LHA(Hwnd, "x \\Ls-wtgl469\共通file\特養入居状況.exe \\Ls-wtgl469\共通file\") = False Then
 MsgBox "LHA ディリクトリ付解凍エラー"
 End If
 
 If LHA(Hwnd, "e -c -m \\Ls-wtgl469\共通file\特養入居状況.exe \\Ls-wtgl469\共通file\") = False Then
 MsgBox "LHA 上書き解凍エラー"
 End If
 
 If LHA(Hwnd, "x -c \\Ls-wtgl469\共通file\特養入居状況.exe \\Ls-wtgl469\共通file\") = False Then
 MsgBox "LHA 上書きディリクトリ付解凍エラー"
 End If
 End Sub
 
 '=======================================================================
 ' LHA 圧縮解凍
 '=======================================================================
 '【引数】
 ' hwd   = ウィンドウハンドル
 ' para  = LHA パラメタ
 '【戻り値】
 ' boolean = 処理結果
 '       TRUE = 正常終了
 '       FALSE = 異常終了
 '【処理】
 ' ・LHA パラメタに従って、LZH の圧縮解凍を行う。
 ' ・圧縮パラメタ "a g:\tmp\test.lzh g:\tmp\ *.sf"
 '         | |        |    |_ 対象ファイル指定
 '         | |        |_ ファイルのあるパス
 '         | |_ 圧縮先パス、ファイル名
 '         |_ 圧縮指定
 ' ・解凍パラメタ "e g:\tmp\test.lzh g:\tmp\"
 '         | |        |_ 解凍先パス
 '         | |_ 対象パス、LZH ファイル名
 '         |_ 解凍指定
 '=======================================================================
 Public Function LHA(hwd As Variant, para As String) As Boolean
 
 Dim rcd As Long
 Dim cons As String
 
 '** LHA 圧縮解凍
 cons = Space(256)
 rcd = Unlha(hwd, para, cons, LenB(cons))
 If rcd <> 0 Then
 LHA = False
 Else
 LHA = True
 End If
 
 End Function
 
 |  |