Excel causing

B

Berny

I'm using VB to open and read/write to an Excel
spreadsheet. The spreadsheet is currently 2.9 meg. The
syntax I use is:
Public Const spdsheet
= "\\servername\mainfolder\subfolder\request_log.xls"

Set wkbook = GetObject(spdsheet)
Set wksheet = wkbook.Worksheets(1)
wkbook.NewWindow

I close the workbook using the syntax:
Set wkbook = Nothing
Set wksheet = Nothing

I can do this only a few times before getting a white
screen that says: "Excel out of memory". After
acknowleging this screen I usually get the Windows blue
screen and have to reboot my PC.

I would appreciate any suggestions:

Thanks,
Berny
 
K

Keith Willshaw

Berny said:
I'm using VB to open and read/write to an Excel
spreadsheet. The spreadsheet is currently 2.9 meg. The
syntax I use is:
Public Const spdsheet
= "\\servername\mainfolder\subfolder\request_log.xls"

Set wkbook = GetObject(spdsheet)
Set wksheet = wkbook.Worksheets(1)
wkbook.NewWindow

I close the workbook using the syntax:
Set wkbook = Nothing
Set wksheet = Nothing

I can do this only a few times before getting a white
screen that says: "Excel out of memory". After
acknowleging this screen I usually get the Windows blue
screen and have to reboot my PC.

I would appreciate any suggestions:

Thanks,
Berny

Before you set the wkbook and to nothing
you should explictly close it and end the application
otherwise you are likely to have multiple Excel processes
running

wkbook.Close
xlapp.Quit

Keith
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top