VBA Generated File Cannot Be Saved

GonzoB

New Member
Joined
Dec 4, 2021
Messages
43
Hi Gurus,

I created a VBA which does some calculation, populates two spreadsheets in the excel file and at the end of the script generates 2 new files on the users computer. For me it works perfectly fine: I run the macro and the files are created in my folder. That's all, nothing else happens for me.

However another user reported that when he runs the macro, first a pop up message asks whether he wants to save the file or not (for me there's no such pop up window appearing). He clicks on yes, but the files are not created. He figured out that this is because he had other unsaved excel files open. When he closes these, we can successfully create the new files with the macro.

I was trying to find the reason for this behavior but I could not. I could not even reproduce the same things. For me there's no pop up window asking whether I want to save the files or not and the VBA always generate the 2 new files, regardless what other excels I have open.

Do you have any ideas
a) why excels asks certain users whether I want to save the file or not?
b) why unsaved excel files blocking the VBA to create new excels?

Thanks in Advance
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Without seeing the code that saves the file, it is hard to say.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,265
Members
452,627
Latest member
KitkatToby

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