Hi
I am trying to extract the data from csv to array using outlook vba. Below code works fine but when i try convert the array to 1D the lenght reduces from 250,000 to approx 58k. I saw some solution using Application.transpose to convert 2D in to 1D but i am getting the error while using application.transpose in outlook.
I am trying to extract the data from csv to array using outlook vba. Below code works fine but when i try convert the array to 1D the lenght reduces from 250,000 to approx 58k. I saw some solution using Application.transpose to convert 2D in to 1D but i am getting the error while using application.transpose in outlook.
VBA Code:
Public email_array()
Sub load_emails_from_file()
strPath = "H:\XXXXX\XXXXX\"
Dim Conn As New ADODB.Connection
Dim mrs As New ADODB.Recordset
'Set cn = CreateObject("ADODB.Connection")
strcon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strPath & ";Extended Properties=""text;HDR=Yes;FMT=Delimited"";"
Conn.Open strcon
strSQL = "SELECT CUSTOMER_NAME FROM Emaillist.csv;"
Dim rs As Recordset
Dim rsARR() As Variant
Set rs = Conn.Execute(strSQL)
email_array = WorksheetFunction.Transpose(WorksheetFunction.Transpose(rs.GetRows))
rs.Close
Set Conn = Nothing
End Sub