Avatar of askbyung
askbyung
Flag 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.
Microsoft AccessMicrosoft ApplicationsMicrosoft Office

Avatar of undefined
Last Comment
askbyung

8/22/2022 - Mon
ashokpumca

askbyung

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


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
askbyung

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
askbyung

ASKER
none
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes