可以在程序中动态引用,给你一个例子: Dim fs As Object, d As Object Set fs = CreateObject("Scripting.FileSystemObject") On Error Resume Next For Each d In fs.Drives Debug.Print d.driveletter & ": 总空间:" & d.TotalSize & "字节,剩余空间:" & d.FreeSpace & "字节" Next
程序运行后,立即窗口总先显示,再显示界面.怎样做运行时不显示立即窗口???通过改变工程属性中的启动对象来解决!!! 一般你这种情况请选择 SUB MAIN()
添加一模块 Sub main() MsgBox "starting" Form1.Show End SubPrivate Sub Form_Load() MsgBox "hello" End Sub
Dim fs As Object, d As Object
Set fs = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
For Each d In fs.Drives
Debug.Print d.driveletter & ": 总空间:" & d.TotalSize & "字节,剩余空间:" & d.FreeSpace & "字节"
Next
一般你这种情况请选择 SUB MAIN()
Sub main()
MsgBox "starting"
Form1.Show
End SubPrivate Sub Form_Load()
MsgBox "hello"
End Sub