top of page

簡単なファイルダイアログ+ファイル名取得

  • 執筆者の写真: ehime-db
    ehime-db
  • 2018年3月8日
  • 読了時間: 1分

Private Sub cmdImport_Click()

'"Microsoft OfficeXX.X Object Library"の項目にチェック Dim intRet As Integer Dim GetFileName As String

With Application.FileDialog(msoFileDialogOpen) .Title = "ファイル選択" 'ダイアログのタイトル .Filters.Clear 'ファイルの種類 .Filters.Add "excelファイル", "*.xlsx" .Filters.Add "すべてのファイル", "*.*" .FilterIndex = 1 'ファイルの種類の初期値(1 = *.csv) .AllowMultiSelect = False '複数ファイル選択を許可しない .InitialFileName = CurrentProject.Path '初期パス intRet = .Show 'ダイアログを表示

 If intRet <> 0 Then

  GetFileName = Trim(.SelectedItems.Item(1))   Else

  GetFileName = ""  End If  End With

 MsgBox GetFileName   DoCmd.TransferSpreadsheet acImport, 10, "T一時Import", GetFileName, True, "" End Sub


 
 
 

Comments


特集記事
最新記事
アーカイブ
タグから検索
ソーシャルメディア
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
-
00:00 / 00:00

© 2018 Ehime Data Bank All Rights Reserved

  • Facebookの社会的なアイコン
  • Twitterの社会のアイコン
  • w-googleplus

お問い合わせ

愛媛県松山市(JP)

電話/ファックス : 089-907-7333

メール : contact@ehime-db.com

地域 : 愛媛県松山市    Ehime Pref. JP

bottom of page