File Exchange

image thumbnail

Excel Macro Example: Sun Rise, Set, Transit, Twilight

version 1.0.1 (58.2 KB) by Meg Noah
to demonstrate writing inputs and reading outputs from an xlsm spreadsheet

4 Downloads

Updated 21 Feb 2020

View Version History

View License

The purpose of this project is to demonstrate how to interact with an Excel xlsm file to write inputs and read outputs from the Excel calculation. For this example, the matlab code sets the inputs of location and time, and reads the values calculated by the spreadsheets: Sun's rise, set, transit, and twilight.

The download includes the spreadsheet xlsm files. The xlsm extension is the spreadsheet that enables visual basic macros. The .BAS file and a text file explaining how to create your own calculator spreadsheet is included in the download.

Cite As

Meg Noah (2020). Excel Macro Example: Sun Rise, Set, Transit, Twilight (https://www.mathworks.com/matlabcentral/fileexchange/74300-excel-macro-example-sun-rise-set-transit-twilight), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)

Meg Noah

Change line 45 in getTwilightTimes.m to:
for k = 2:size(twilightTable,1)

MATLAB Release Compatibility
Created with R2019b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!