ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro to change default setting on startup (https://www.excelbanter.com/excel-discussion-misc-queries/256158-macro-change-default-setting-startup.html)

paankadu

Macro to change default setting on startup
 
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
--
Thanks,
Angie

Luke M

Macro to change default setting on startup
 
Back in the macro editor go to the ThisWorkbook module. Paste this in:

Sub Workbook_Open()
Application.DefaultWebOptions.UpdateLinksOnSave = False
End Sub
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"paankadu" wrote:

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
--
Thanks,
Angie


Daryl S

Macro to change default setting on startup
 
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).

--
Daryl S


"paankadu" wrote:

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
--
Thanks,
Angie



All times are GMT +1. The time now is 04:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com