Macro to change default setting on startup

P

paankadu

I am in need of a macro that can change a default setting in excel and for it
to run on startup


The task is:
Tools
Options
General
Web Options
Files
uncheck Update links on save


Below is the recording of the macro:

With ActiveWorkbook.WebOptions
..RelyOnCSS = True
..OrganizeInFolder = True
..UseLongFileNames = True
..DownloadComponents = False
..RelyOnVML = False
..AllowPNG = False
..ScreenSize = msoScreenSize800x600
..PixelsPerInch = 96
..Encoding = msoEncodingWestern
End With
With Application.DefaultWebOptions
..SaveHiddenData = True
..LoadPictures = True
..UpdateLinksOnSave = False
..CheckIfOfficeIsHTMLEditor = True
..AlwaysSaveInDefaultEncoding = False
..SaveNewWebPagesAsWebArchives = True
End With

End Sub

It is set in a module and I would like it to run on startup. By saving it in
the originial document it will carry over to each version that is saved.

Thanks in advance for your assistance
Angie
 
L

Luke M

Back in the macro editor go to the ThisWorkbook module. Paste this in:

Sub Workbook_Open()
Application.DefaultWebOptions.UpdateLinksOnSave = False
End Sub
 
D

Daryl S

Paankadu -

Set the name of the macro to Auto_Open. Look at the RunAutoMacros method in
VBA Help in Excel (help from the code window).
 

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