askbyung
asked on
Access & Excel Error message - Not enough system resource to display completely
Recently I got a new computer and upgraded all the system but received this error message(Not enough system resource to display completely). I haven't had any problem with the old system. After exporting an Excel format report from Access using VB script, Excel Macro template fixes the report format and the error message occurs.
ASKER
Would you please review the script below----
Function OutputData()
Dim DateStamp As Variant
DateStamp = Format(Now() - (Now() - Int(Now() / 7) * 7), "mm-dd-yy")
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Instock", "C:TEST\ Instock by Size " & DateStamp & ".xls", True, "Data"
SleepNow 10
End Function
Function ExcelMacro()
SleepNow 5
Dim DateStamp As Variant
DateStamp = Format(Now() - (Now() - Int(Now() / 7) * 7), "mm-dd-yy")
Dim myExcelFile As Object
'Create MS Excel object.
Set myExcelFile = CreateObject("Excel.Applic ation")
'Show Excel.
myExcelFile.Visible = True
'Open the file.
myExcelFile.Workbooks.Open ""C:TEST\ Instock by Size " & DateStamp & ".xls"
myExcelFile.Application.Ru n "MACRO"
myExcelFile.Application.Ac tiveWorkbo ok.Save
myExcelFile.Application.Qu it
Function SleepNow(NumSecs As Integer)
Dim dIn As Date
On Error Resume Next
dIn = Now
If NumSecs = 0 Then NumSecs = 1
Do
DoEvents
Loop Until DateDiff("s", dIn, Now) > NumSecs
End Function
Function OutputData()
Dim DateStamp As Variant
DateStamp = Format(Now() - (Now() - Int(Now() / 7) * 7), "mm-dd-yy")
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Instock", "C:TEST\ Instock by Size " & DateStamp & ".xls", True, "Data"
SleepNow 10
End Function
Function ExcelMacro()
SleepNow 5
Dim DateStamp As Variant
DateStamp = Format(Now() - (Now() - Int(Now() / 7) * 7), "mm-dd-yy")
Dim myExcelFile As Object
'Create MS Excel object.
Set myExcelFile = CreateObject("Excel.Applic
'Show Excel.
myExcelFile.Visible = True
'Open the file.
myExcelFile.Workbooks.Open
myExcelFile.Application.Ru
myExcelFile.Application.Ac
myExcelFile.Application.Qu
Function SleepNow(NumSecs As Integer)
Dim dIn As Date
On Error Resume Next
dIn = Now
If NumSecs = 0 Then NumSecs = 1
Do
DoEvents
Loop Until DateDiff("s", dIn, Now) > NumSecs
End Function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
none
try doing this,
http://www.mrexcel.com/forum/showthread.php?62223-quot-Not-enough-system-resources-to-display-completely-quot/page2