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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

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