Tag: types

将空types从XLS行转换为string

业余时间:我必须使用Python,因为Ruby的Roo gem速度非常慢,并且Node.js可用的库无法parsing这些特定的XLSX文件(可能会损坏代码)? Python的xlrd速度很快,能够parsing这些文件,因此我需要将XLSX文件的内容作为JSON转储到另一个文件中。 文档的前几行包含大量的空单元格,通过xlrd ,看起来像这样: [empty:u'', empty:u'', text:u'loan Depot Daily Leads', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u'', empty:u''] 我希望遍历列表并逐行转储JSON文件,如下所示: import xlrd import json book = xlrd.open_workbook("loan Depot Daily Leads.xlsx") # print("The number of worksheets is {0}".format(book.nsheets)) […]

用户表单 – types不匹配错误

我是新来的编码(2个月),我主要是从networking上的代码。 对于上下文,我从这里的一些说明如何使用用户userform更新我的工作表中的值。 第一位是好的,我能够从我的工作表拉回数据到我能够编辑的用户表单,但试图然后更新工作表中的数据是给我一个'types不匹配'的错误。 代码如下,当我点击“更新”button Private Sub cmdupdate_Click() If Me.cmbslno.Value = "" Then MsgBox "SL No Can Not be Blank!!!", vbExclamation, "SL No" Exit Sub End If Sheets("Sheet 1").Select Dim rowselect As String rowselect = Me.cmbslno.Value Cells(rowselect, 2) = Me.TextBoxdate.Value Cells(rowselect, 3) = Me.TextBoxraisedby.Value Cells(rowselect, 5) = Me.ComboBoxsite.Value Cells(rowselect, 6) = Me.ComboBoxfacility.Value Cells(rowselect, 7) = Me.ComboBoxpdriver.Value […]

excel VBA中的types不匹配

我试图学习VBA。 此代码: Dim i As Integer Dim damage As String i = 1 Do While 1 damage = CStr(Worksheets("charakters").Range("d14").Value) you_min_damage = CInt(Left(damage, i)) If Right(i, 0) = "-" Then Trim (you_min_damage) Exit Do End If i = i + 1 Loop 导致这个问题(在4次迭代中): 在细胞D14我有“4 – 11”。 我想分开第一个数字nad将其更改为整数。 You_min_damage是整数。

types不匹配,我已经在pipe理器中命名的范围

我希望有人能帮我弄清楚为什么我在这种情况下得到一个types不匹配。 我会期望范围variables“returnDetectionRange”和名称pipe理器中名为“returnChangeDetectionRange”的对象都是Rangetypes,但我得到一个错误。 Dim returnDetectionRange As Range Set returnDetectionRange = ActiveWorkbook.Names("returnChangeDetectionRange") 在名称pipe理器中,returnChangeDetectionRange指的是使用偏移公式的dynamic范围: =OFFSET(Returns!$D:$D, 0, 'Market Value'!$E$2) 感谢您花时间看我的问题!

VBA错误匹配错误13

我是VBA的新手,我写了一个Sub来parsing包含在单个单元格中的CSV信息,并将某些数据片段返回给电子表格中的其他单元格。 它是一个相对简单的代码,但我找不到错误。 它是一个Err 13 Mismatch行Moods = Application.Index(fullArray, 0, 3)任何帮助将不胜感激。 Private Sub parseCSV() 'Parse "Notes" column and return Moods/Keywords to their apropriate cells Dim CSV As String Dim fullArray As Variant Dim lRow As Long Dim Keywords As Variant Dim Moods As Variant Dim i As Long lRow = ActiveSheet().Range("BL" & ActiveSheet().Rows.Count).End(xlUp).Row For i = 3 […]

如何在运行时使types化数据集或其他结构?

美好的一天! 我尝试在没有数据库的情况下在运行时创buildtypes化数据集或数据表。 我有Excel文件,并想parsing它,并打字input数据集。 因为,如果是这样,我可以做这样的事情: foreach(Person personRow in dataSetPerson.Rows) { var name=personRow.name;//etc } 但是我不能。 我试图从这个问题来做,但失败了。 请告诉我如何在运行时创build一些types化的结构(数据集或可能是另一个)?谢谢!

Excel VBA集合和自定义数据types

我正在尝试学习如何创build一个自定义的数据types,然后用一个集合。 我以另一种方式解决了这个问题,但是这是从我自动化的时间表报告开始的。 我最初想要一个二维数组与不同的数据types。 当我不能这样做的时候,一些研究导致了一组自定义数据types的想法。 然而,我发现的例子不断推动我创build一个class级。 我不舒服,看来这应该是可行的。 这里是我寻找的东西(我从我在这个网站上find的一个例子开始): Option Explicit '***** User defined type Public Type MyType MyInt As Integer MyString As String MyDoubleArr(2) As Double End Type Public ColThings As Collection Sub CollectionTest() Dim x As Integer Dim vrecord As MyType For x = 1 To 4 vrecord.MyInt = x vrecord.MyString = "Matt" vrecord.MyDoubleArr(0) = […]

string在spring自动转换

我正在使用SpringMVC在Spring中开发一个项目。 我从(.xls)文件导入数据。 问题是: 我正在读取这个值“ 945854955 ”作为一个string,但在DB中保存为“ 9.45854955E8 ” 这个值“ 26929 ”保存为“ 26929.0 ” 这个值“ 21/05/1987 ”保存为“ 31918.0 ” /读取代码 // import … @RequestMapping(value="/read") public String Read(Model model,@RequestParam CommonsMultipartFile[] fileUpload) throws IOException, EncryptedDocumentException, InvalidFormatException { List<String> liste = new ArrayList(); Employe employe = new Employe(); String modelnom = null; liste = extraire(modelnom); //See the second code […]

将类作为Variantparameter passing时发生运行时错误

当我这样做: Dim data_set As DataSet Set data_set = New DataSet 'some meaningless operations here list.Add CVar(data_set) 在list.Add行,我得到一个运行时错误13,争论types不匹配。 这是添加子的标题: Public Sub Add(ByRef vItem As Variant, Optional index As Long) 我在这里错过了什么? 编辑:只是启用所有的错误,并在这段代码失败,现在与运行时错误9: Private Function GetListCount() As Long ClearError On Error GoTo Err GetListCount = UBound(mList) – LBound(mList) + 1 Exit Function Err: GetListCount = 0 End Function […]

用户定义types并将数组传递给函数

我有麻烦传递从用户定义的types的数组函数: 定义types(在标准模块中): Public Type JPrinters Available() As String Default As String End Type function列出所有可用的打印机(标准模块): Function ListPrinters() As JPrinters Dim GetPrinters As Object: Set GetPrinters = CreateObject("WScript.Network").EnumPrinterConnections Dim i As Integer Dim j() As String 'Array of Printer Names ReDim j(0 To GetPrinters.Count \ 2 – 1) For i = 0 To UBound(j) 'Load this array […]