【问题标题】:XlPasteType Enumeration (Excel) for Picture用于图片的 XlPasteType 枚举 (Excel)
【发布时间】:2018-11-01 03:54:23
【问题描述】:

下面的链接提供了可以在powershell中使用的excel中的粘贴类型列表

https://docs.microsoft.com/en-us/office/vba/api/excel.xlpastetype

以及下面的参考,其中应用了 powershell 的粘贴类型:

Excel & PowerShell - PasteSpecial Failure With VLOOKUPs

图片有粘贴类型吗?或者有没有办法使用powershell在excel中粘贴为图片?

【问题讨论】:

  • 也许更详细。你想把什么粘贴为图片,从哪里粘贴?

标签: excel powershell


【解决方案1】:

您可以自己查找可能的值:

PS> Add-Type -ASSEMBLY "Microsoft.Office.Interop.Excel" | out-null
PS> [Enum]::GetValues([Microsoft.Office.Interop.Excel.xlPasteType]) |
         Select-Object @{n="Name";e={"$_"}},value__

Name                                value__
----                                -------
xlPasteValidation                         6
xlPasteAllExceptBorders                   7
xlPasteColumnWidths                       8
xlPasteFormulasAndNumberFormats          11
xlPasteValuesAndNumberFormats            12
xlPasteAllUsingSourceTheme               13
xlPasteAllMergingConditionalFormats      14
xlPasteValues                         -4163
xlPasteComments                       -4144
xlPasteFormulas                       -4123
xlPasteFormats                        -4122
xlPasteAll                            -4104

与发布链接中的表格没有什么不同。 (只是排序:追加|sort Name)

【讨论】:

  • 您好,以上数值没有粘贴为图片。我需要能够将值粘贴为图片。在 excel 中,有一种方法可以通过粘贴特殊功能手动执行此操作。
  • 据此article 插入图像的处理方式完全不同。
猜你喜欢
  • 1970-01-01
  • 2014-06-03
  • 1970-01-01
  • 1970-01-01
  • 2011-08-19
  • 2012-05-31
  • 2014-10-09
  • 2011-07-22
  • 1970-01-01
相关资源
最近更新 更多