| 
    
     |  | ▼774 さん: >LHA形式なら普通に解凍すれば良いんじゃないの?
 >
 >h t t p://homepage2.nifty.com/sak/w_sak3/doc/sysbrd/vb_t23.htm
 
 以下のVBAを実行させると、Unlhaがsub又はfunctionが定義されたいませんのエラーが発生します。誠に申し訳ございませんお教えください。
 
 Sub テスト2()
 '  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
 '** 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
 
 '=======================================================================
 ' 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
 
 
 |  |