*Attached is an access datase in zip format. Hold down shift when running as there is a form that runs on startup.*
I have a database that I use to generate excel spreadsheets from sql statements based on date. For some reason It woks with some data but not other data. Here is the scenario:
Choose dates 11/6/2011 to 11/9/2011. Exports perfectly.
Choose dates anything after 11/9/2011 and it crashes with unable to set the FormulaArray property of the Range class.
Here is a snippet:
Second line from bottom.objResultsRange.FormulaArray = objExcel.Transpose(varResults) is where it is crashing on dates after 11/9/2011
I'm thinking it's an item in 1 of the fields I'm pulling that is crashing the transpose array. Are there any restrictions to characters in an array?
All suggestions are GREATLY appreciated. I need help on this pronto. Can someone take a look and let me know.
I have a database that I use to generate excel spreadsheets from sql statements based on date. For some reason It woks with some data but not other data. Here is the scenario:
Choose dates 11/6/2011 to 11/9/2011. Exports perfectly.
Choose dates anything after 11/9/2011 and it crashes with unable to set the FormulaArray property of the Range class.
Here is a snippet:
Code:
Set objExcel = CreateObject("Excel.Application")
objExcel.Workbooks.Add
Set objResultsWorkbook = objExcel.Workbooks(objExcel.Workbooks.Count)
Set objResultsSheet = objResultsWorkbook.Worksheets("Sheet1")
Set objResultsRange = objResultsSheet.Range("A2:E" & 2 + UBound(varResults, 2))
objResultsRange.FormulaArray = objExcel.Transpose(varResults)
objResultsSheet.Range("A1").Value = "Item Sold"
Second line from bottom.objResultsRange.FormulaArray = objExcel.Transpose(varResults) is where it is crashing on dates after 11/9/2011
I'm thinking it's an item in 1 of the fields I'm pulling that is crashing the transpose array. Are there any restrictions to characters in an array?
All suggestions are GREATLY appreciated. I need help on this pronto. Can someone take a look and let me know.