如何控制word文档中嵌入的单元格范围 [英] How to control range of cells embedded in word document

查看:85
本文介绍了如何控制word文档中嵌入的单元格范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在word宏中使用此命令将excel电子表格连接到word文档。  我遇到的问题是不知道如何控制单词doc中显示的单元格范围。   excel文件包含多个工作表。  我需要
特定工作表上的一组特定列(这些是固定的),但行数可能会有所不同。   

I am using this command in a word macro  to connect an excel spreadsheet to a word document.  The problem I have is don't know how to control the range of cells that is shown in the word doc.  The excel file has several sheets.   I need a specific set of columns (these are fixed), on a specific sheet,  but the number of rows may vary.   

    Selection.InlineShapes.AddOLEObject ClassType:=" Excel.Sheet.8",FileName:= _

        "C:\ Users \swilson\Desktop\Quotes\Book1.xls",LinkToFile:= True,_

        DisplayAsIcon:= False

    Selection.InlineShapes.AddOLEObject ClassType:="Excel.Sheet.8", FileName:= _
        "C:\Users\swilson\Desktop\Quotes\Book1.xls", LinkToFile:=True, _
        DisplayAsIcon:=False

我搜索并搜索了一些提示,但我还没有想出来。  我不是在寻找副本,粘贴。  我需要链接。  我需要一种方法来控制word doc中显示的单元格。

I have searched and searched for some tips but I haven't figured it out yet.  I am not looking for a copy, paste.  I need the link.  I need a way to control which cells are shown in the word doc.

任何提示或评论都将不胜感激。  谢谢 

Any tips or comments would be appreciated.  Thanks 

推荐答案

当你嵌入时,你得到了整个excel文件。所以你可以不要只嵌入部分单元格。

When you embed you are getting the entire excel file.So you can't embed only part of cells.

如果你将所有工作表隐藏起来除了必需的一个,并且隐藏除了所需的一行之外的所有行列,可以采用一种解决方法。保护它然后再插入单词。

One workaround can be if you cen hide all sheet except required one and hide all rows columns except the required one.Protect it and then again embed in word.

--------------------------- -------------------------------------------------- ----------------

---------------------------------------------------------------------------------------------

请不要忘记点击 "投票为有用的" ,如果有任何帖子可以帮助您,并且
标记为答案 ,如果它解决了问题。

Please do not forget to click "Vote as Helpful" if any post helps you and Mark as Answer if it solves the issue.


这篇关于如何控制word文档中嵌入的单元格范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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