Issue opening excel files via VBA

Assamita

Board Regular
Joined
Sep 23, 2011
Messages
131
Hi Excel gurus.
I have an automated process that, among a whole lot of other things, at one point, long story short, it opens some files from a network, copies the content from them and closes them again.

This process was working no issues in a local machine where the network servers were located. Recently, this process was moved to a virtual machine with access to this network, but in another server location.
Ever since then, looks like this process has some troubles opening some of these files, they get stuck in the Downloading screen, and don't open up until I hit "Cancel", which odd enogh, opens the file.

I suspect it might have to do with cache memory or something like that.
My code doesn't include any Set Excel.Application or Set wb = Nothing, or anything like that. It just opens the workbooks and closes them (I'm not a programmer, I'm just a self-learner with some-but-not-much programming knowledge). Could that be a reason? I don't know what the above statements actually do.

Thank you in advance
 
Last edited:

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Please post your code

SET is used to assign a value to an object. So you have a workbook object (variable) called wb. Unlike a normal variable you can't just give it a value, you have to assign something to it so you would e.g.
Code:
Set wb = workbooks("workbook name")
to create the object variable. Then to clear memory later you would
Code:
Set wb = nothing
to clear it from memory.
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,435
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top