使用UiPath打开受密码保护的Excel电子表格

时间:2016-06-24 18:40:01

标签: excel passwords uipath

我想知道是否有人成功使用UiPath打开受密码保护的XL电子表格。

我尝试使用"打开工作簿"并在密码字段中输入密码......但是没有用。

我尝试使用Open Application ...但我似乎无法与密码对话框交谈。

真的没弄了!

3 个答案:

答案 0 :(得分:1)

更新Excel活动。使用新的Excel应用程序范围。设置密码属性。

答案 1 :(得分:0)

尝试保存此受密码保护的Excel虚拟数据文件(https://cdn-business2.discourse.org/uploads/uipath/original/2X/2/25c38fb93744b863e5db1e50f757a6cdf8b77128.xlsx)并根据以下代码运行它(另存为XAML,即UiPath文件)。

希望有所帮助。

<Activity mc:Ignorable="sap sap2010 sads" x:Class="excel_password" mva:VisualBasic.Settings="{x:Null}" sap2010:WorkflowViewState.IdRef="excel_password_1"
 xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
 xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
 xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
 xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
 xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
 xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
 xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
 xmlns:sd="clr-namespace:System.Data;assembly=System.Data"
 xmlns:ui="http://schemas.uipath.com/workflow/activities"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <TextExpression.NamespacesForImplementation>
    <sco:Collection x:TypeArguments="x:String">
      <x:String>System.Activities</x:String>
      <x:String>System.Activities.Statements</x:String>
      <x:String>System.Activities.Expressions</x:String>
      <x:String>System.Activities.Validation</x:String>
      <x:String>System.Activities.XamlIntegration</x:String>
      <x:String>Microsoft.VisualBasic</x:String>
      <x:String>Microsoft.VisualBasic.Activities</x:String>
      <x:String>System</x:String>
      <x:String>System.Collections</x:String>
      <x:String>System.Collections.Generic</x:String>
      <x:String>System.Data</x:String>
      <x:String>System.Diagnostics</x:String>
      <x:String>System.Drawing</x:String>
      <x:String>System.IO</x:String>
      <x:String>System.Linq</x:String>
      <x:String>System.Net.Mail</x:String>
      <x:String>System.Xml</x:String>
      <x:String>System.Xml.Linq</x:String>
      <x:String>UiPath.Core</x:String>
      <x:String>UiPath.Core.Activities</x:String>
      <x:String>System.Windows.Markup</x:String>
      <x:String>System.Xml.Serialization</x:String>
    </sco:Collection>
  </TextExpression.NamespacesForImplementation>
  <TextExpression.ReferencesForImplementation>
    <sco:Collection x:TypeArguments="AssemblyReference">
      <AssemblyReference>System.Activities</AssemblyReference>
      <AssemblyReference>Microsoft.VisualBasic</AssemblyReference>
      <AssemblyReference>mscorlib</AssemblyReference>
      <AssemblyReference>System.Data</AssemblyReference>
      <AssemblyReference>System</AssemblyReference>
      <AssemblyReference>System.Drawing</AssemblyReference>
      <AssemblyReference>System.Core</AssemblyReference>
      <AssemblyReference>System.Xml</AssemblyReference>
      <AssemblyReference>System.Xml.Linq</AssemblyReference>
      <AssemblyReference>UiPath.Core</AssemblyReference>
      <AssemblyReference>UiPath.Core.Activities</AssemblyReference>
      <AssemblyReference>PresentationFramework</AssemblyReference>
      <AssemblyReference>WindowsBase</AssemblyReference>
      <AssemblyReference>PresentationCore</AssemblyReference>
      <AssemblyReference>System.Xaml</AssemblyReference>
      <AssemblyReference>System.Data.DataSetExtensions</AssemblyReference>
    </sco:Collection>
  </TextExpression.ReferencesForImplementation>
  <Sequence DisplayName="excel_password" sap2010:WorkflowViewState.IdRef="Sequence_2">
    <Sequence.Variables>
      <Variable x:TypeArguments="sd:DataTable" Name="dt" />
      <Variable x:TypeArguments="x:String" Name="dt_op" />
    </Sequence.Variables>
    <ui:ReadRange AddHeaders="True" DataTable="[dt]" DisplayName="Read range" sap2010:WorkflowViewState.IdRef="ReadRange_1" Password="uipath" SheetName="Sheet1" WorkbookPath="dummy.xlsx">
      <ui:ReadRange.Range>
        <InArgument x:TypeArguments="x:String">
          <Literal x:TypeArguments="x:String" Value="" />
        </InArgument>
      </ui:ReadRange.Range>
    </ui:ReadRange>
    <ui:OutputDataTable DataTable="[dt]" DisplayName="Output data table" sap2010:WorkflowViewState.IdRef="OutputDataTable_1" Text="[dt_op]" />
    <WriteLine DisplayName="Write line" sap2010:WorkflowViewState.IdRef="WriteLine_1" Text="[dt_op]" />
    <ui:MessageBox Caption="{x:Null}" ChosenButton="{x:Null}" Buttons="Ok" DisplayName="Message box" sap2010:WorkflowViewState.IdRef="MessageBox_1" Text="[dt_op]" TopMost="True" />
    <sads:DebugSymbol.Symbol>dyxDOlxVc2Vyc1xtbWlhb1xEb3dubG9hZHNcZXhjZWxfcGFzc3dvcmQueGFtbA47A0sOAgEBQAVGFAIBDUcFR48BAgEISAVIaAIBBUkFSbUBAgECQC9ANQIBEkMLQzoCARFAhgFAjgECARBAmQFAoQECAQ9ArwFAuwECAQ5HgwFHjAECAQtHI0cpAgEJSFxIZQIBBkmaAUmjAQIBAw==</sads:DebugSymbol.Symbol>
  </Sequence>
  <sap2010:WorkflowViewState.ViewStateManager>
    <sap2010:ViewStateManager>
      <sap2010:ViewStateData Id="ReadRange_1" sap:VirtualizedContainerService.HintSize="314,87" />
      <sap2010:ViewStateData Id="OutputDataTable_1" sap:VirtualizedContainerService.HintSize="314,22" />
      <sap2010:ViewStateData Id="WriteLine_1" sap:VirtualizedContainerService.HintSize="314,61" />
      <sap2010:ViewStateData Id="MessageBox_1" sap:VirtualizedContainerService.HintSize="314,59" />
      <sap2010:ViewStateData Id="Sequence_2" sap:VirtualizedContainerService.HintSize="336,473">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="excel_password_1" sap:VirtualizedContainerService.HintSize="376,553" />
    </sap2010:ViewStateManager>
  </sap2010:WorkflowViewState.ViewStateManager>
</Activity>

答案 2 :(得分:0)

使用Excel应用程序范围并通过它读取excel。

当您在右侧使用excel应用程序时,在文件下您有一个名为“密码”的字段。

输入密码,以打开excel工作表。

这应该有效