vba,试图改变一个打开的文件夹地址

基本上我想打开一个Windows资源pipe理器,并浏览打开的窗口。 改变打开的窗口本身的path。 我想了一个方法来获得当前的窗口path,虽然它不帮助我:

Set abc = CreateObject("Shell.Application") for each cell in abc.windows - gives us all the opened windows if cell.name = "File Explorer" 'etc 

以及如何打开一个窗口:

 Application.ThisWorkbook.FollowHyperlink Address:="D:\", NewWindow:=True 

有更多的方法来做到这一点,在shell中做到这一点:

 Shell("explorer.exe " & "c:\", vbNormalFocus) 

基本上我的整个问题是如何改变一个打开的窗口地址,我的意思是,我可以find它作为一个对象与shell.application,我如何继续从这里?

另外,我如何使一个无形的打开资源pipe理器? ty提前。

该控件是一个WebBrowser控件。

添加Microsoft Internet控件参考库。

对我来说,这是Windows Explorer而不是File Explorer所以我在我的代码中使用了这个,但是如果你的是不同的,只需使用你所调用的任何东西。

 Sub test() Dim abc As Object Dim Cell As Variant Set abc = CreateObject("Shell.Application") For Each Cell In abc.Windows If Cell.Name = "Windows Explorer" Then Cell.Navigate "C:\" 'to go to different address cell.Visible = True 'to toggle between visible and not End If Next Cell End Sub