Tag: 属性

如何在Excel中获取内置的Sharepoint属性

我试图从Excel工作簿中具有Sharepoint属性的工作簿中获取属性。 我可以使用ThisWorkbook.ContentTypeProperties(“示例”)获取在Sharepoint中创build的属性。 但是,它并没有为版本和标识find任何属性。 因此,因为它不ContentTypeProperties,CustomTypeProperties或BuiltinDocumentProperties我怎样才能检索版本和ID在Excel中? 感谢您的阅读。

在VBA 2003中列出一个类的属性

我已经全面search,看看这个问题是否有一个简单的答案,但似乎并没有… 我正在使用Excel VBA 2003(是的,我知道这是过时的,但我不能改变这一点),我想要做的就是列出给定的自定义类中的所有可读属性的名称和值。 我想要做这样的事情: 类定义(用于类的标题为cFooBar) Option Explicit Private pFoo As String Private pBar As String Public Property Get Foo() As String Foo=pFoo End Property Public Property Get Bar() As String Bar=pBar End Property 调用代码 Dim myFooBar as cFooBar, P as Property myFooBar=new cFooBar For Each P in myFooBar.Properties Debug.Print P.Name, P.Value Next 当然,这不起作用,因为似乎没有自定义类的“属性”集合成员(或者至less不是你可以得到的),也没有“属性”types。 有人知道这个方法吗? […]

应用程序。计算属性

我面临一个问题。 有时当我打开一个工作簿(没有macros),我的计算方法更改为手动。 研究这个问题我发现了以下原因。 testing显示,计算设置默认设置为“自动”。 只有在以下情况下才会设置为手动: (1)您已将默认工作簿更改为计算模式设置为手动的工作簿; (2)是否有某种AutoOpenmacros设置计算模式; (3)如果您有一些自动加载计算设置为手动的工作簿(XLSX或XLTX,包括个人工作簿); 要么 (4)如果通过在Windows中双击计算设置为手动的工作簿来启动Excel。 我不明白原因的解释(1),(3),(4),因为Application.Calculation是一个应用程序级属性。 有人能解释一下工作簿与应用程序属性的关系吗?

在VBA中使用属性集时出现“属性的无效使用”

我知道有很多关于这个问题的线程和问题,一般来说,这个错误是很明显的。 移动物体时,大多数人不使用SET关键字。 我是。 这是发生了什么事情: 这是在一个Excel表中,所以我做了一些function,以跟踪列和索引,以便每次运行应用程序将重新索引列,所以我可以做像.Cells(row_num, pCust_index("custID"))以防列更改。 我有一个名为custContagions的表单。 这只是一个模式窗口,允许用户添加/删除/编辑客户的传染状态。 它包含一个属性: Private pCust_index as dictionary 它也包含这个属性setter: Public Property Set set_cust_index(ByRef custIndex As Dictionary) Set pCust_index = New Dictionary Set pcust_index = custIndex End Property 相当直线前进吗? 获取字典对象,重置我的索引并指向现有的传递对象。 现在,在呼吁forms我有另一边: Private Sub newCustContagious_LBL_Click() Dim contForm as New custContagions Call contForm.set_cust_index(pCust_index) 'note pCust_index is a private here too Call contForm.Show … […]

Excel VBA错误:相同属性的属性过程的定义不一致

这一定是明显的东西,但我卡住了,所以也许你们可以帮助我。 考虑VBA自定义对象中的以下代码: Private pSkipTrade As Boolean Property Let SkipTrade(value As Double): If value = 0 Then pSkipTrade = False Else pSkipTrade = True End If End Property Public Property Get SkipTrade() As Boolean SkipTrade = pSkipTrade End Property 谁能帮我? 提前tks!

Excel VBA不会在编译时捕获无效的属性

Excel / VBA编译器似乎不会在编译时捕获无效的属性。 这是一个简单的例子: Option Explicit Sub CompileExample() Application.Calculzzzzzzzzation = xlCalculationAutomatic End Sub 它会在运行过程中失败,但编译得很好。 通常这对我来说不会是一个问题,但我试图编译一些机器生成的代码,以显示错误而不执行它。 任何方式来强制编译器执行严格的检查?

需要Java中的文件的内容创builddate

我知道这个问题有几个问题,但没有Java解决scheme。 我的问题是一样的: 我的目标是显示一个Excel文件的date。 但是,如果我从互联网下载文件,自动将创builddate和修改date设置为当前时间和date。 我查看了文件的属性,发现在“详细信息”一节中,在个人信息下有一个名为“Source”的部分,在那里它有一个名为'Content Created'的属性和原始date文件。 所以,我不想要: – 但是这个 :-

VBA Excel – 使用Get / Let属性将string数组传递给类变体types

我一直在寻找一个答案只是传递和返回一个string数组在VB模块。 以下是我的示例代码。 我不断收到错误“不能分配给arrays”上线 Orgs.pIDOrgList = ID 有什么想法吗? class级代码: 'Class COrgList Private m_vpIDOrgList() As Variant 'Public pGROrgList() As String Function getOrgList(Comp As String) As String() If Comp = "Gram Stain" Then getOrgList = m_pGROrgList ElseIf Comp = "Identification" Then getOrgList = m_pIDOrgList Else MsgBox "Incorrect Comp Name" End If End Function Public Property Get pIDOrgList() As […]

在导出的Excel数据中使用列标题的显示名称属性

我正在尝试使用DisplayName属性来修改导出到Excel文件的数据中的列标题。 我想要“我的名字”,但得到“我的名字”。 数据是从查询返回的数据,转换为List ,然后到DataTable ,然后导出到Excel。 我还有什么可以尝试? 这里有一些讨论说这个function正在被添加。 使用.NET Framework 4 public class MyExcelViewModel { private string myName; //[System.ComponentModel.DisplayName("Mine Name")] // no effect //[System.ComponentModel.DataAnnotations("My Name")] // doesn't compile //[System.ComponentModel.DisplayNameAttribute("My Name")] // no effect [Display(Name = "My Name")] // no effect public string MyName { get; set; } } public class MyController : Controller // initialize exportList […]

VBA定义一个variables的属性

我是新来的论坛,也是VBA的新手(一个星期前才开始学习)。 是否有可能在variables中定义一个属性? 我有一条线,看起来像这样: Cells(i, j).Formula = "=" & .Cells(i, j).Address(External:=True, RowAbsolute:=False, ColumnAbsolute:=False) 我必须写几个单元格,所以我最终得到了许多这样的行; 如果可能的话,我想做一些事情: dim prop as string prop = "Address(External:=True, RowAbsolute:=False, ColumnAbsolute:=False)" Cells(i, j).Formula = "=" & .Cells(i, j).prop 可以这样做吗?