str是关键字,换一个变量试试。
Private Sub Command1_Click()str1="d:\temp"
aa$= Dir("d:\temp", vbDirectory)
bb$= Dir(str1, vbDirectory)End Sub