広告
広告
アクセスからエクセルを操作するときに、今あるシート名を列挙できたら良いなと。
Dim DB As Database Dim Exl As String Dim Tbl As TableDef Dim strText As String Dim l As Long Exl = "エクセルフルパス" l = 1 Set DB = OpenDatabase(Exl, False, False, "Excel 8.0;HDR=NO;") For Each Tbl In DB.TableDefs If Tbl.Attributes And dbSystemObject Then Else If l = 1 Then strText = Tbl.Name l = 0 Else strText = strText & "; " & Tbl.Name End If End If Next Tbl DB.Close Set DB = Nothing strText = Replace(strText, "$", "") Me.strExSheet.RowSource = strText 'リストボックスに結果を放り込んだり…
広告