我有一个需要由目录填充的列表框.我已成功用目录填充列表框但我的问题是我无法获得所选项目的值.我在SelectedIndexChanged事件上放置了一个断点,但我的Web应用程序似乎没有运行该代码.
这是我填充列表框的代码:
        lstDirectories.DataSource = dtDirectories;
        lstDirectories.DataValueField = "DirectoryID";
        lstDirectories.DataTextField = "DirectoryName";
        lstDirectories.DataBind();
这就是我从SelectedIndexChanged事件的列表框中获取值的方法:
        TextBox1.Text = lstDirectories.SelectedItem.Value.ToString();
我在这里做错了吗?谢谢您的帮助!:)
我正在尝试在button_click事件中打开excel文件.我打开的前四个excel文件没有遇到任何错误,但是当我的宏打开第五个时,它会停止并显示此运行时错误:
Run-time error '-2147021892 (80070bbc)':
office has detected a problem with this file. 
To help protect your computer this file cannot be opened.
这是我打开excel文件的代码:
    Set wb = Workbooks.Open(fileName:=fileName, UpdateLinks:=True)