Author |
Topic |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 12 May 2017 : 19:28:04
|
Wrote a program to read and display data about EBooks; but I'm getting a "type mismatch" error at line 91 (in red) when it tries to open an ".opf" file (XML/text). Anyone have an idea on how to solve this?
|
Edited by - Carefree on 14 June 2017 18:13:33 |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 13 May 2017 : 03:38:52
|
shouldn't it be 0 for ASCII
Constant Value Description TristateUseDefault 2 Opens the file using the system default. TristateTrue 1 Opens the file as Unicode. TristateFalse 0 Opens the file as ASCII.
|
MVC .net dev/test site | MVC .net running on Raspberry Pi |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 02 June 2017 : 17:50:27
|
Yeah, forgot to change the comment. Didn't make any difference, though. Tried with 0, 1, True, False. Even renamed the file to .txt (since it's basically a text file) and opened it; same error. |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 04 June 2017 : 03:02:18
|
have you tried
objFSO.OpenTextFile(strTemp, 1) or objFSO.OpenTextFile(strTemp, 1, 0, 0)
could be confusing parameters
IIRC objFSO.OpenTextFile(strTemp, 1,1) means open strTemp for reading and create if not exists (since only three parameters passed, you either need to pass just two or all 4 params for what you are trying to do
FileSystemObject.OpenTextFile(fname,mode,create,format) |
MVC .net dev/test site | MVC .net running on Raspberry Pi |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 14 June 2017 : 18:19:06
|
Solved. The issue lies with XML formatting, had to use an entirely different approach.
|
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
|
|
Topic |
|
|
|