unwanted quotes in string output

benjiboy

New Member
Joined
Dec 4, 2018
Messages
1
I have a little bit of VBA code which reads a 13MB binary file into memory. Once there I want to edit it and write it out to a second file.
The problem is, using the write command, (WRITE #2 ,a$ - where a$ is my edited 13MB string), I get chr(34)'s inserted at the beginning of the output and at every place in the string where there is already a chr(34), (ie it's doubling up the quotation marks - I guess because it thinks it's found a terminator and wants to start a new string).
My input file is BINARY ACCESS READ and I've tried using BINARY ACCESS WRITE and OUTPUT for my output file. I have tried WRITE and PRINT. I have tried outputting the string in a single shot and byte by byte, with the same frustrating result.
Can anyone offer me some guidance, please?
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
From the VBA Write# Statement help page: `Unlike the Print # statement, the Write # statement inserts commas between items and quotation marks around strings as they are written to the file.`` I have not tested Print# to confirm that statement. You claim to have tried Print [sic], to no avail. Maybe you should try again.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top