Link to home
Start Free TrialLog in
Avatar of askbyung
askbyungFlag for United States of America

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.
Avatar of ashokpumca
Flag of India image

Avatar of askbyung


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.Application")
'Show Excel.
myExcelFile.Visible = True
'Open the file.
myExcelFile.Workbooks.Open ""C:TEST\ Instock by Size " & DateStamp & ".xls"
myExcelFile.Application.Run "MACRO"

Function SleepNow(NumSecs As Integer)

  Dim dIn  As Date
  On Error Resume Next
  dIn = Now
   If NumSecs = 0 Then NumSecs = 1

   Loop Until DateDiff("s", dIn, Now) > NumSecs

End Function
Avatar of askbyung
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial