Excel office 13 运行缓慢且不支持 xlrd(无法读取超链接的内容)
Excel operating slow with office 13 and not supporting xlrd (not able to read hyperlink's content)
我主要面临两个问题:
我有一个 xls
格式的 excel,我把它移到了 xlsm
格式。此后,xlrd
无法读取超链接。我别无选择,只能使用 xlrd
。有什么解决办法吗?
并且 xls
在 Office 13 上运行速度太慢。我也将其转换为 xlsm
格式。但还是太慢了。 xlrd
有什么可以做的吗?实际上我的 python 脚本被很多人用来处理 excel。因此,我不能强制每个最终用户配置 xlsm
(如果没有其他选项可用,这将是最后一个选项)。
为此,问题的发生是因为在 xlsm 的情况下未启用格式化文本标志。唯一的解决方案是创建一个新列,我们在其中放置 sheet 名称并读取它,而不是从超链接中获取它。
Sub Button1_Click()
Dim a As Integer
Dim b As String
Dim c As Integer
On Error Resume Next
For Each hl In Sheets("TPD Sheet").Hyperlinks
'Get the sheet name
If Not IsNull(hl) Then
c = Application.Evaluate(hl.Range.row)
MsgBox "Aakash" & Application.Evaluate(hl.Range.row)
Set r = Application.Evaluate(hl.SubAddress)
'MsgBox "Row number being operated upon -> " & Application.Evaluate(hl.Range.row)
'Get the cell where the sheet name to be put
a = Application.Evaluate(hl.Range.row)
b = Application.Evaluate(hl.Range.Column)
Set TxtRng = Sheets("MySheet").Cells(a, "D")
TxtRng.value = r.Parent.name
End If
Next hl
End Sub
Select disable hardware graphics acceleration
而且会快一点。仍在努力使其更快。
我主要面临两个问题:
我有一个
xls
格式的 excel,我把它移到了xlsm
格式。此后,xlrd
无法读取超链接。我别无选择,只能使用xlrd
。有什么解决办法吗?并且
xls
在 Office 13 上运行速度太慢。我也将其转换为xlsm
格式。但还是太慢了。xlrd
有什么可以做的吗?实际上我的 python 脚本被很多人用来处理 excel。因此,我不能强制每个最终用户配置xlsm
(如果没有其他选项可用,这将是最后一个选项)。
为此,问题的发生是因为在 xlsm 的情况下未启用格式化文本标志。唯一的解决方案是创建一个新列,我们在其中放置 sheet 名称并读取它,而不是从超链接中获取它。
Sub Button1_Click() Dim a As Integer Dim b As String Dim c As Integer On Error Resume Next For Each hl In Sheets("TPD Sheet").Hyperlinks 'Get the sheet name If Not IsNull(hl) Then c = Application.Evaluate(hl.Range.row) MsgBox "Aakash" & Application.Evaluate(hl.Range.row) Set r = Application.Evaluate(hl.SubAddress) 'MsgBox "Row number being operated upon -> " & Application.Evaluate(hl.Range.row) 'Get the cell where the sheet name to be put a = Application.Evaluate(hl.Range.row) b = Application.Evaluate(hl.Range.Column) Set TxtRng = Sheets("MySheet").Cells(a, "D") TxtRng.value = r.Parent.name End If Next hl End Sub
Select
disable hardware graphics acceleration
而且会快一点。仍在努力使其更快。