PDA

View Full Version : EASY EXCEL AUTOMATION



Guest.Visitor
01-01-1995, 02:00 AM
EASY EXCEL AUTOMATION I downloaded this from Midrange and would like to use it, but as I can't remember when it was, I can not find any information about it nore any way to use it. This tips normally permits, as I can see, to make some file transfers from AS/400 with SQL selection (but behind this, it looks like Visual Basic instructions), and it could be what I'm actually need. Does anyone use this trick, if yes, could you remember me if the description was anywhere in the forums or just something published in Midrange Magazine so I could try to understand the way it will work. thanks in advance

dstubbs@amarr.com
06-12-2001, 11:27 AM
With ActiveSheet.QueryTables.Add(Connection:=Array(Arra y( _ "ODBC;DRIVER={Client Access ODBC Driver (32-bit)};SYSTEM=SYSTEMNAMEHERE ;CMT=0;DBQ=LIBRARYNAMEHERE;NAM=0;DFT=0;DSP=0;TFT=0 ;TSP=0;DEC=0;XDYNAMIC=0;" _"RECBLOCK=0;BLOCKSIZE=8;SCROLLABLE=0;TRANSLATE=1;LA ZYCLOSE=0;LIBVIEW=0;REMARKS=0;CONNTYPE=0;SORTTYPE= 0;LANGUAGEID=ENU;SORTWEIGHT" _ ), Array("=0;PREFETCH=0;MGDSN=0;")), Destination:=Range("A1")) .Sql = Array( _ "SELECT FILE.FIELD"" & Chr(13) & "" & Chr(10) & "FROM S103R96M.AMRPRDDTA.SALSRP SALSRP" & Chr(13) & "" & Chr(10) _ ) .FieldNames = True .RefreshStyle = xlInsertDeleteCells .RowNumbers = False .FillAdjacentFormulas = False .RefreshOnFileOpen = True .HasAutoFormat = True .BackgroundQuery = True .TablesOnlyFromHTML = True .Refresh BackgroundQuery:=False .SavePassword = True .SaveData = True End With Put this in a vba macro and run...after editing of course...

Guest.Visitor
06-19-2001, 03:17 AM
Doug, I tried to put this in a VBA macro. I always received a compile error. Is the syntax correct ? Did you try this with VBA ? Kind regards.