使用十六进制编辑器打开 .dat 文件
我正在尝试通过 excel 中的 vba 使用十六进制编辑器打开一系列 .dat 文件,然后开始复制和粘贴过程。有谁知道如何使用 Excel 中的 vba 内的 excel 以外的程序打开文件?另外,我编写的代码中存在一些错误。
test = count
Do While (test >= 0)
Workbooks.Open Filename:=AllFiles(test) 'Open .dat file in order of Highest to Lowest count index. ERROR: SUBSCRIPT OUT OF RANGE. Need to open .dat files with Hex Edit HOW?
test = test - 1
Loop
'How do I manipulate the Hex Editor program: HxD with vba excel??
I'm trying to Open up a series of .dat files with a Hex Editor thru the vba in excel and then start a copy and paste process. Does anybody know how one can open up a file using a program other than excel inside the vba in Excel? Also I have a few errors in the code that I've written.
test = count
Do While (test >= 0)
Workbooks.Open Filename:=AllFiles(test) 'Open .dat file in order of Highest to Lowest count index. ERROR: SUBSCRIPT OUT OF RANGE. Need to open .dat files with Hex Edit HOW?
test = test - 1
Loop
'How do I manipulate the Hex Editor program: HxD with vba excel??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过 vba 打开十六进制编辑器来读取文件,然后剪切/粘贴文件的内容似乎有点矫枉过正。如果您只想将文件的数据读入变量,请尝试此处发布的解决方案:http://www.excelforum.com/excel-programming/332741-getting-text-file-into-a-vba-string-variable.html 将文件直接读取到变量,而不必求助于其他应用程序和剪贴板操作。
本质上,如果您想打开灯,只需直接扳动开关即可。每次您进入/离开房间时雇用/解雇某人来为您做这件事效率非常低。
Opening a hex editor via vba to read a file then cut/paste the file's contents seems like overkill. If all you want is to read the file's data into a variable, then try the solutions posted here: http://www.excelforum.com/excel-programming/332741-getting-text-file-into-a-vba-string-variable.html which read a file directly into a variable, without having to resort to other apps and clipboard operations.
In essence, if you're trying to turn on a light, just flip the switch directly. Hiring/Firing someone to do it for you each time you enter/leave a room is highly inefficient.