Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel appears to access network for some reason

Status
Not open for further replies.

dean12

MIS
Oct 23, 2001
273
US
I could be wrong but.....

We have an Excel (Office XP) workbook that is normally stored on a server connected to our LAN. It has a BUNCH of VBA code.

I have copied that workbook to my local machine and when I execute it, IT APPEARS that there are tons of network accesses going on (the little icon in the system tray stays lit continuously).

I stepped the code in debug mode and IT APPEARS thtat when VBA functions like UCASE or TRIM are called, the network icon lights up.

I disabled my network connection and the spreadsheet continues to operate just fine.

I took a look at the references box and unchecked and checked again everything that I could. Everything seems to indicate that it is looking to the local drive.

Any thoughts?
 
dean12,
where is excel installed? local or server?
regards,
longhair
 
dean12,
check the event viewer anything at the time the macro is running?
is office / excel installed on the server at all?
regards,
longhair
 
I rebooted the machine first.

Fired up task manager. No applications running.

Fired up the spreadsheet by selecting it from the Documents list. EXCEL is now running as an application.

I triggered the VBA code to do it's thing and the network activity light goes on.

No additional processes are started, EXCEL is still the only running application.

HOWEVER,

Excel is consuming about 10% of the CPU resources and another process "CSRSS" which was already running begins to consume over 50% of the CPU.

Anything to that?
 

This is really strange. I tested this workbook on my home computer and the logic runs in about 8 seconds. Emailed it to the office and on my office machine, well over 1 1/2 minutes. Same MS Office versions, almost the same machines. Not enough difference to account for such a massive change in time to process.

That pesky network indicator just lights up. I caught it running the following code snipit:


With ActiveCell.MergeArea
.WrapText = True
CurrentRowHeight = .RowHeight
ActiveCellWidth = ActiveCell.ColumnWidth
For Each CurrCell In Selection
MergedCellRgWidth = CurrCell.ColumnWidth + MergedCellRgWidth
Next
.MergeCells = False
.cells(1).ColumnWidth = MergedCellRgWidth
.EntireRow.AutoFit
PossNewRowHeight = .RowHeight
.cells(1).ColumnWidth = ActiveCellWidth
.MergeCells = True



and this is just mundane stuff. It seems like everytime I say:

ActiveSheet......

anything, then a network hit occurs and a hundred packets or so are exchanged with somewhere.
 

Well,,,,,,,,,,,,,I think I may be on the trail of discovering what is causing this issue.

I loaded a packet sniffer and discovered that all these packets were going to one server. After looking in the packet, I could see that they had references to "C:\spool\..." and then I saw a connection. It looks like (as I step the code) that the network traffic occurs when working with cells and then I noticed it really seems to happen when doing cell formatting.

Thus I believe that Excel is going out to query the default printer to determine how to handle the formatting. Since my default printer is a networked printer, boom.....lots of network traffic.

To prove this, I switched my default printer to a local print defice on my machine. Network traffic went to zero and execution time went from 1 1/2 minutes to 7 seconds.

Wow.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top