我对 activeworkbook/activesheet 属性有一些疑问,希望得到您的帮助:
谢谢你。
最佳答案
In any instances, there would be at maximum only one activeworkbook or no, and that applies to activesheet. Is that right?
是的。
.ActiveWorkbook
返回 Workbook
表示事件窗口(顶部的窗口)中的工作簿的对象。If properties like ranges,cells,... are not fully qualified when used, they are by default meant to be that of the activeworkbook.activesheet. Is that right?
是的
Debug.Print rng.Parent.Name '<~~ This will give you the name
Will the activeworkbook change to another workbook by vba actions other than activating the other workbook?
对的,这是可能的。例如,如果您将事件工作簿发送到
Back
如果下一个窗口在 zOrder 中,则将其最小化是一个工作簿,那么它将被激活When I use wb.ws.range(cells(x1,y1),cells(x2,y2)), are the cells implied to be the cells of wb.ws? Or do they need to be qualified?
仅当 ws 处于事件状态时,否则它们将引用
Activesheet
因此,完全限定您的对象总是好的With ws
Set Rng = .Range(.Cells(x1, y1), .Cells(x2, y2))
End With
Is it possible to run the vba codes stored in the modules of a workbook without activating the workbook?
是的。您可以使用
Application.Run
关于excel - activeworkbook/activesheet什么时候改变?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44582730/