M
Mike
I have coded using VBA to output a query to a sheet in a protected workbook
and it works fine. I added code to output a 2nd query to another sheet in
the same workbook and when it runs it causes various columns on the first
sheet to change from their format to a date format. If I comment out the
code to output to the 2nd sheet the first sheet goes back to normal.
Here is the code I am using for outputting to the 2nd sheet:
' Write the data to the Termed Detail worksheet.
Set objSht = objWkb.Worksheets("TermedDetails")
objSht.Range("A2").CopyFromRecordset rs1
and it works fine. I added code to output a 2nd query to another sheet in
the same workbook and when it runs it causes various columns on the first
sheet to change from their format to a date format. If I comment out the
code to output to the 2nd sheet the first sheet goes back to normal.
Here is the code I am using for outputting to the 2nd sheet:
' Write the data to the Termed Detail worksheet.
Set objSht = objWkb.Worksheets("TermedDetails")
objSht.Range("A2").CopyFromRecordset rs1