如何获得一系列列作为集合? [英] How to get a range of columns as collection?

查看:91
本文介绍了如何获得一系列列作为集合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于上下文,我试图将Excel工作表中的特定范围的列作为集合导入到Blue Prism对象中.

For context, I am trying to import a certain range of columns in an Excel sheet into a Blue Prism object as a collection.

因此,我有一个工作表,其中包含从A到AM的列.当我将工作表作为集合时,名为"Column1"到"Column10"的空白列(第一次)和名为"Column1"到"Column19"的空白列(第二次,这次请注意其19列)会神秘地出现在集合中.这些列中没有数据-没有空格,没有任何内容.

So I've got a worksheet with columns from A to AM. When I get sheet as collection, blank columns named "Column1" to "Column10" (the first time) and "Column1" to "Column19" (the second time, note its 19 cols this time) mysteriously appear in the collection. No data is in these columns - no whitespace, nothing.

为了防止任何事情弄乱集合cols,我正在寻找一种方法来获取一系列 columns 作为集合,例如A-AM.行数不确定,因此获取范围作为收集操作不合适.预先感谢!

In order to prevent anything of the sort from messing up the collection cols, I'm looking for a way to get a range of columns as a collection, e.g. A - AM. The number of rows is undetermined, so the get range as collection action is not suitable. Thanks in advance!

推荐答案

因此,我从不真正喜欢默认对象来获取范围作为集合.您可以在Excel VBO对象中创建一个新动作(请务必小心,因为重新导入默认对象基本上会删除该动作.我通常将其重命名为"MS Excel VBO Customized"或类似的名称)

I never really liked the default object to get range as collection because of that. You can create a new action in the Excel VBO object (do make sure to be careful with that since re-importing the default object will basically erase the action. I usually rename it as 'MS Excel VBO Customized' or something along those lines).

我的操作方式如下:

  1. 打开"MS Excel VBO"对象,并复制将工作表的愤怒作为集合",并将其命名为将工作表范围作为新的集合"(或您认为合适的任何东西):

  1. Open the 'MS Excel VBO' object and duplicate the page 'Get Worksheet Rage as Collection' and name it 'Get Worksheet Range as Collection New' (or anything you deem suitable):

编辑代码阶段:给它一个新名称(因为代码阶段在同一对象中不能具有相同的名称),并更改输入和代码阶段以匹配以下内容(我称新范围为这里的地址",但只要您始终保持一致,就可以使用其他名称:

Edit the code stage: give it a new name (because code stages cannot have the same name in the same object) and change the inputs and code stages to match the following (I'm calling the new range as 'Address' here, but feel free to name it something else as long as you are consistent throughout):

编辑开始阶段.您可以删除开始单元格"和结束单元格"的先前数据项,并为地址"创建一个:

Edit the start stage. You can delete the previous data items for Start Cell and End Cell and create one for Address:

发布并保存对象.然后,您可以从正在处理的对象或过程中使用它,并使用诸如 A:AM 之类的范围.

Publish and save the object. You can then use it from the object or process you are working on and use a range such as A:AM.

这篇关于如何获得一系列列作为集合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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