INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Running a Macro from within Onedrive

Running a Macro from within Onedrive

(OP)
I have Excel spreadsheets that I would like to allow access to from my website. Using Onedrive, I can embed the HTML code for the spreadsheet in the website and allow access to anyone. This does not work with the macro's that I have in the spreadsheet because I use a graphic or button to run the macro. How can I run the macro without a graphic or button? For instance, is there a command that will run the macro when a cell has changed or when a recalculation occurs?

RE: Running a Macro from within Onedrive

As far as I know you can't run VBA macros when running Excel through a browser. You can open Excel from Onedrive, but then you have access to all graphics and other facilities, so I presume that is not what you are doing.

You can write VBA code to run a macro when certain events occur, or you can access a list of all macros by pressing Alt-F8, but neither will won't work from a browser.

As far as I know your only option is to re-write the macro in JavaScript.

Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/

RE: Running a Macro from within Onedrive

(OP)
Hi Doug,

Thanks, I'm going to try the following:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$3" Then
Call My Macro
End If
End Sub

This works in Excel 365 so I'll try it via the website.

RE: Running a Macro from within Onedrive

(OP)
As you stated, this did not work. I do not know how to write the macro in JavaScript, so I guess I'm out of luck. Thanks anyway for your advice.

RE: Running a Macro from within Onedrive

The lack of support for improving and extending VBA in Excel is very frustrating, but it seems that Microsoft see VBA as a legacy application that has no place in their vision for the future. I think this is a huge wasted opportunity for them, but I don't see any prospect of things changing.

If I do come across a way forward (with a manageable learning curve) I'll post here (but I wouldn't hold your breath).

Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close