excel vba - VBA CSV Import Code in Shared Network not working on co-workers connections -
i have coded csv import file imports , sorts information, import section of code being skipped no errors on co-workers computer , not mine. both access same file in same folder on same shared network, reason not running code same.
there no error codes, , set connection shared network using same network folder: n:\12abc\program\main (put csvs here)
sub importallcsv() dim fname variant, r long r = 1 fname = dir("*.csv") while fname <> "" importcsvfile fname, activesheet.cells(r, 1) r = activesheet.usedrange.rows.count + 1 fname = dir loop end sub sub importcsvfile(filename variant, position range) activesheet.querytables.add(connection:= _ "text;" & filename _ , destination:=position) .name = replace(filename, ".csv", "") .fieldnames = true .rownumbers = false .filladjacentformulas = false .refreshonfileopen = false .backgroundquery = true .refreshstyle = xlinsertdeletecells .savepassword = false .savedata = true .adjustcolumnwidth = true .textfilepromptonrefresh = false .textfileplatform = xlmacintosh .textfilestartrow = 1 .textfileparsetype = xldelimited .textfiletextqualifier = xltextqualifierdoublequote .textfileconsecutivedelimiter = false .textfiletabdelimiter = true .textfilesemicolondelimiter = false .textfilecommadelimiter = false .textfilespacedelimiter = false .textfileotherdelimiter = "," .textfilecolumndatatypes = array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) .refresh backgroundquery:=false end end sub
please help! thank you
Comments
Post a Comment