/    Sign up×
Community /Pin to ProfileBookmark

Closing Excel properly?

Hello, I’m fairly new to javascript. I’m making a website for my personal use that will read from Excel and display some data on an HTML page and I’ve been learning javascript as I go.

A problem I have is when I leave the website running overnight (it refreshes itself every minute), an error eventually pops up that says
“Not enough memory to run Microsoft Office Excel. Please close other applications and try again.”
Internet Explorer also gives the error “Automation Server can’t create object” on the line

[CODE]var excel = new ActiveXObject(“Excel.Application”);[/CODE]

so anyways heres my code for opening excel

[CODE]var excel = new ActiveXObject(“Excel.Application”);
excel.visible=false;
var excelfile = excel.Workbooks.Open(“displayinfo.xls”);
var excelsheet = excel.Worksheets(“Sheet1”);[/CODE]

I use actually vbscript to go through task manager and kill the “EXCEL.EXE” process, but that didnt help get excel out of memory and I tried this code to no avail-

[CODE]excelfile.Close(false);
excel.Quit();
excel = null;
setTimeout(“CollectGarbage()”,1);[/CODE]

I’ve been searching the internet for a solution for days now, and I’ve tried my best to solve this on my own. Any help on how to correctly release excel from memory would be greatly appreciated.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @Yoduh spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...