标题:实时错误‘91’ 对象变量或with块变量未设置
取消只看楼主
VBhere
Rank: 2
等 级:论坛游民
帖 子:21
专家分:19
注 册:2010-3-9
结帖率:100%
已结贴  问题点数:10 回复次数:0 
实时错误‘91’ 对象变量或with块变量未设置


点击“确定”没问题,点击“取消”就出现错误——“实时错误‘91’  对象变量或with块变量未设置”

代码如下:
Private Sub Command1_Click()
Dim spShell As New Shell
Dim spFolder As Folder
Dim spFolderitem As New ShellFolderItem
Dim spPath As String
Const WINDOW_HANDLE = 0
Const NO_OPTIONS = 0
Set spShell = CreateObject("Shell.Application")
Set spFolder = spShell.BrowseForFolder(WINDOW_HANDLE, "选择目录:", NO_OPTIONS, "")
Set spFolderitem = spFolder.Self
spPath = spFolderitem.Path
spPath = Replace(spPath, "\", "\")
Text4.Text = spPath
End Sub

请问应该怎么解决这个问题?
搜索更多相关主题的帖子: 对象 实时 变量 
2010-03-09 16:38



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-298924-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.235224 second(s), 9 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved