不要关注打开的工作簿 [英] Focus not in opened workbook

查看:83
本文介绍了不要关注打开的工作簿的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 

我正在使用ExcelObj.workbooks.open(文件名:文件)打开现有工作簿(.xlsx)文件。但是,打开此文件时,焦点不会更改为新的工作簿窗口。它保持在我称之为开放方法的同一个窗口中。这个
问题仅发生在Office 2013中,因为Office 2010我能够获得关注。


任何关注开放工作簿的想法? 

I'm using the ExcelObj.workbooks.open(Filename: File)open an existing workbook(.xlsx) file. However, when this file is opened the focus does not change to the new  workbook window . It stays in the same Window that I called the open method from.This issue is happening only in Office 2013 where as office 2010 i am able to get focus

Any ideas to gain focus on opened workbook? 

紧急

王子拉詹

推荐答案

我建议将打开的工作簿设置为新变量激活它:

I sugget to set the opened workbook to new variable the activate it:

Dim TargetBook As Workbook

Dim TargetBook As Workbook

设置TargetBook = Workbooks.Open("your path\file name.xlsx")

TargetBook.Activate

Set TargetBook = Workbooks.Open("your path\file name.xlsx")
TargetBook.Activate

设置TargetBook =无

set TargetBook = nothing


这篇关于不要关注打开的工作簿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆