Skip to content

Commit

Permalink
Module1.bas updates for new column headers in imagechoices.csv
Browse files Browse the repository at this point in the history
  • Loading branch information
bullmoose20 committed Mar 28, 2024
1 parent d6834a7 commit 82043c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Module1.bas
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ Sub ImportCSVs(folderPath)
Set wsImageChoices = ThisWorkbook.Worksheets.Add
wsImageChoices.Name = "ImageChoices"
ThisWorkbook.Queries.Add Name:="ImageChoices", Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Source = Csv.Document(File.Contents(""" & Filename1 & """),[Delimiter="";"", Columns=8, Encoding=65001, QuoteStyle=QuoteStyle.None])," & Chr(13) & "" & Chr(10) & " #""Promoted Headers"" = Table.PromoteHeaders(Source, [PromoteAllScalars=true])," & Chr(13) & "" & Chr(10) & " #""Changed Type"" = Table.TransformColumnTypes(#""Promoted Headers"",{{""Title"", type text}, {""Type"", t" & _
"ype text}, {""Rootfolder"", type text}, {""LibraryName"", type text}, {""Textless"", type logical}, {""Fallback"", type logical}, {""TextTruncated"", type logical}, {""Url"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Changed Type"""
"let" & Chr(13) & "" & Chr(10) & " Source = Csv.Document(File.Contents(""C:\Users\bullmoose20\ppm\Logs\ImageChoices.csv""),[Delimiter="";"", Columns=9, Encoding=65001, QuoteStyle=QuoteStyle.None])," & Chr(13) & "" & Chr(10) & " #""Promoted Headers"" = Table.PromoteHeaders(Source, [PromoteAllScalars=true])," & Chr(13) & "" & Chr(10) & " #""Changed Type"" = Table.TransformColumnTypes(#""Promoted Headers"",{{""Title"", type text}, {""Type"", t" & _
"ype text}, {""Rootfolder"", type text}, {""LibraryName"", type text}, {""Language"", type text}, {""Fallback"", type logical}, {""TextTruncated"", type logical}, {""Download Source"", type text}, {""Direct Provider Link"", type text}})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Changed Type"""

With wsImageChoices.ListObjects.Add(SourceType:=0, Source:= _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=ImageChoices;Extended Properties=""""", Destination:=wsImageChoices.Range("$A$1")).QueryTable
Expand Down

0 comments on commit 82043c4

Please sign in to comment.