DISABLE OR CONFIRM MESSAGE WHEN OPENING FILE

Marcelo Strehlow

New Member
Joined
Nov 23, 2019
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Good night!!!
A little help here with VBA ...
When I open a file exported from a company system (.xls) Excel gives a file format warning and extension does not match ... Do you want to open it anyway?
Just click yes that opens normally, but I need to run through VBA ...
How do I confirm / click Yes to open the file via VBA? Or better yet, disable this message to open the file normally?
Already tried displayalerts, enableevents and in the trust center, file lock settings ...
Another detail, when opened, when saved, displays the warning save it as Web Page ... This is no problem because I do not need to save ... It's just information to help solve, who knows.
Thank you!
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hi Marcelo,
the times I encountered that warning message, the file had e.g. an .xls extension, but was an .xlsx file internally, or once it was a .csv, but the extension it was given was .xls. So Excel can open the file, but will notice when opening that the internal file format is something different. You could try manually changing the extension (.xlsx, .xls, .csv are the most likely ones) and see with which extension you don't get the warning. You could afterwards change the extension with VBA before opening it or add Application.DisplayAlerts = False to the beginning of your macro (and Application.DisplayAlerts = True to the end).
Hope that helps,
Koen
 
Upvote 0
Good night Rijnsent!
Thank you very much for your reply!
This is exactly it! Actually the file extension is .htm so when I try to save the suggested format is webpage ...
As for Application.DisplayAlerts does not solve. I'm using it and still the message appears.
I'll see what I can do with this information. Any suggestions will be welcome.
Best regards
 
Upvote 0
Please post the VBA code you have, that makes replying easier. If you have a test-file that you want to load available (e.g. through a onedrive/dropbox link), that would help too.
Cheers,
Koen
 
Upvote 0
Good Night Rijnsent!
File at PesquisaWorkflow.xls
You may notice that displays the message on opening. This is the message I need to get around.
I use VBA integrated with Internet Explorer to search our intranet system. When I click Open with Excel, the message occurs. I need to open the file to continue macro execution.
Best regards
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,303
Members
449,078
Latest member
nonnakkong

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