- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用以下函数将文件读入电子表格。我正在考虑添加一个停止按钮( something like this ),但问题是,当它运行时,它完全锁定了 Excel,我无法以任何方式与之交互。有没有办法优雅地停止这样的事情?请注意,这些是巨大的文件(超过 500,000 行)
Function LoadFile(m)
Dim WrdArray() As String
Dim txtstrm As TextStream
Dim line As String
Dim clm As Long
Dim Rw As Long
Dim Dash As Worksheet
Set Dash = Sheets("Dashboard")
Set cellStatus = Dash.Range("E3")
Set txtstrm = FSO.OpenTextFile("s:\views_" & m & ".txt")
Rw = 1
Do Until txtstrm.AtEndOfStream
If Rw Mod 4 = 0 Then cellStatus.Value = "Loading " & m & "... /"
If Rw Mod 4 = 1 Then cellStatus.Value = "Loading " & m & "... |"
If Rw Mod 4 = 2 Then cellStatus.Value = "Loading " & m & "... \"
If Rw Mod 4 = 3 Then cellStatus.Value = "Loading " & m & "... -"
line = txtstrm.ReadLine
clm = 1
WrdArray() = Split(line, "|!|")
For Each wrd In WrdArray()
Sheets(m).Cells(Rw, clm) = wrd
clm = clm + 1
Next wrd
Rw = Rw + 1
Loop
txtstrm.Close
LoadFile = Rw
End Function
最佳答案
首先,关闭屏幕刷新和计算。
Application.ScreenUpdating = False
Application.Calculation = xlManual
Application.ScreenUpdating = True
Application.Calculation = XlCalculationAutomatic
Dim myCount as Long
...your loop starts here
myCount = myCount + 1
If myCount mod 1000 = 0 then
toContinue = msgBox("Continue with macro?",vbYesNo)
If toContinue = vbNo then exit sub
End if
...continue loop
If myCount mod 1000 = 0
更好的东西......基本上是1000或其他东西的偶数。
关于vba - 停止密集的文件处理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33640065/
关闭。这个问题是not reproducible or was caused by typos .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 5 个月前关
我正在尝试使用摄像机跟踪多个人。我不想使用 blob 分割技术。我想做什么: 执行背景减法以获得隔离人们运动的掩码。 在这些区域执行基于网格的光流 -我最好的选择是什么? 我正在努力实现。我已经尝试过
OpenCV 有 very good documentation on generating SIFT descriptors ,但这是“弱 SIFT”的一个版本,其中关键点由原始 Lowe algo
我有一个 cholmod_dense 数据结构: cholmod_dense* ex = cholmod_l_solve(CHOLMOD_A, L, B, &com); 我想提取这些值并将它们复制到另
这是先前发布的关于在 python 中使用 OpenCVs 密集筛选实现的问题的后续问题 (OpenCV-Python dense SIFT)。 使用建议的代码进行密集筛选 dense=cv2
我是计算机视觉的新手。我正在学习 Dense SIFT 和 HOG。对于密集 SIFT,算法只是将每个点视为一个有趣的点并计算其梯度向量。 HOG 是另一种用梯度向量描述图像的方法。 我认为 Dens
我正在尝试使用 openCV-python 2.4 计算密集 SIFT import cv2 def gen_sift_features(gray, step_size, gamma): de
我正在使用 OpenCV 实现词袋图像分类器。最初我测试了在 SURF 关键点中提取的 SURF 描述符。我听说 Dense SIFT(或 PHOW)描述符更适合我的目的,所以我也尝试了它们。 令我惊
我有一个密集的 Ax=b 类型的方程组要在我的 C++ 程序中求解,我希望在 boost 中使用 UBLAS 来实现该解决方案。在其他一些问题中,我发现人们正在使用扩展 LAPACK,但不幸的是,它似
我目前有一台配备 Opteron 275 (2.2Ghz)(双核 CPU)和 4GB RAM 以及速度非常快的硬盘的机器。我发现即使是使用 C++ 模板(想想 boost 等)编译一些简单的项目时,我
我是一名优秀的程序员,十分优秀!