O
O
Olesya_1902021-06-01 14:58:53
excel
Olesya_190, 2021-06-01 14:58:53

How to open CSV file without splitting data into columns?

Good afternoon dear experts.

Problem and decided to ask you for help.

There is a file with data in .CSV (the program unloads in this format).
There is a .VBS script to transfer data from CSV to MS Excel template (.XLT).

The whole transfer is done like this:

XLCSV.ActiveSheet.range("A21").Copy
XLSheet.ActiveSheet.Cells(13,8).PasteSpecial(8)


To open source and template files I use this:
Dim XLCSV, XLSheet
Set XLCSV = CreateObject("Excel.Application")
Set XLSheet = CreateObject("Excel.Application")
XLCSV.Application.Workbooks.Open "c:\Export\Export.csv"
XLSheet.Application.Workbooks.Open "c:\Export\COMPASSSurveyReport.xlt"
XLSheet.Visible=True


The problem is that there is data of the form:
60b61ed47b972406585014.jpeg

After the script is processed, it looks like this in .CSV (if you make XLCSV.Visible=True):
60b61f548ea72176646287.jpeg

And in the final file in MS Excel: The
60b61f95c3b06330127539.jpeg

question is how to prevent splitting into columns using a comma or other characters?
Since if you just double-click to open CSV, then the data is not divided into columns:
60b620195db7c718040193.jpeg
That is, in this situation, I could use TextToColumns for controlled separation.

I can change the separator between the uploaded values ​​and set any.

If you have other ideas, I'd be happy to hear them.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Olesya_190, 2021-06-02
@Olesya_190

Found a way. I upload data to .TXT and open it using the same method:

XLCSV.Application.Workbooks.Open "c:\Export\Export.txt"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question