How to suppress messages?

J

Jan Nademlejnsky

1. My macro saves spreadsheet sometimes over the existing spreadsheet. How to suppress message "The file already exists. Do you want to ...." and save it regardless if it exists or not?

also,

2. I use these statements:
Range("F2").Select

Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True

This opens Spreadsheet, which is password protected. Is it possible to hard code the password so the process continues without waiting for the password to be entered.

BTW I know that I can use this:

Workbooks.Open FileName:=ThisWorkbook.Path & "\HT.xls", UpdateLinks:=0, ReadOnly:=False, WriteResPassword:="surveys"

but it does not work with my sheet which is collecting life data from various instruments (pressure, volume, temperature..), called "Uniformance."

I would appreciate your help.

Jan
 
F

Frank Kabel

Hi
For the first question: use the following lines at the beginning and at
the end
Application.displayalerts = false
and
Application.displayalerts = True
 
J

Jan Nademlejnsky

Frank,
Exactly, what I was looking for. Thank you very much. Hopefully, somebody
will help me with the second question.
Thanks
Jan
 

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