Share via

Excel workbook to run code stored remotely

Anonymous
2018-07-27T11:44:42+00:00

Is it possible for an excel workbook to run VBA code stored in the cloud?

I've looked around but haven't found anything for this subject.

I feel like it has to be possible in some form though.

Should I be looking into .NET, Azure or network connections to the excel sheet?

Thank you for any guidance

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2018-07-28T07:11:54+00:00

    In VBA there is always a possibility to get the code.

    There are many offers on the web to protect a VBA project, some are just stupid, some sophisticated, but so far I have been able to open any VBA project and look at the code.

    And if you dive really deep into an office file, then you can also extract the binary VBA data and write yourself a decompiler.

    The description of how Office saves or reads a VBA Project is officially available.

    MS-OVBA Office VBA File Format Structure Specification

    https://msdn.microsoft.com/en-us/library/office...

    So what are the options?

    You can make it illegible to humans by replacing each expression with a different string, e.g.

    Sub IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIl()
    Dim IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIlI, IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIll, IIIIIIIIIIIIIIIIIIIIIIIIIIIIIlII
    IIIIIIIIIIIIIIIIIIIIIIIIIIIIIlII = Array(67, 111, 100, 101, 115, 99, 114, 97, 109, 98, 108, 101, 114, 32, 98, 121, 32, 65, 110, 100, 114, 101, 97, 115, 32, 75, 105, 108, 108, 101, 114)
    For IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIlI = 0 To UBound(IIIIIIIIIIIIIIIIIIIIIIIIIIIIIlII)
    IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIll = IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIll & Chr(IIIIIIIIIIIIIIIIIIIIIIIIIIIIIlII(IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIlI))
    Next
    MsgBox IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIll
    End Sub
    

    Looks like nonsense but works, try it.

    A better protection offers an external DLL, which does not contain plain text and extracting parts from it is not easy, but still possible.

    The idea of protecting a code is really old, when I started programming over 30 years ago it was about modifying a compiled EXE file so that you could no longer examine it with an assembler debugger.

    That was a sport at the time and as a byproduct some treacherous viruses comes up that made the antivirus industry desperate ... there are viruses that can rewrite there own code.

    But what is it good for? After my years of experience for nothing.

    If you show people a project and how they can work with it, then any professional programmer can at least mimic this. There is no need to see the code.

    This is normal for freelancers like me, every customer comes with an idea he has seen somewhere and now wants a program that works for his purposes.

    The only question that matters is: Do I have the background information to do it?

    I never protect my codes.

    I prefer to use my strength to convince my customer through good work so that he will call me again next time.

    Andreas.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2018-07-27T17:08:20+00:00

    Hi,

    You can protect VBA code with a password as explained :

    https://www.excel-easy.com/vba/examples/protect...

    Hope this will be helpful !

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2018-07-27T14:04:23+00:00

    Thank you Andreas.

    If anyone knows the answer to this, its probably you.

    How do professional developers protect their VBA code from being accesed/misappropriated by sophisticated users?

    If much time and effort is spent developing a VBA application thats run in Excel, it could be very important for the owner to secure it.

    I thought storing the code on the cloud but somehow running it remotely would be something worth exploring.

    Was this answer helpful?

    0 comments No comments
  4. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2018-07-27T13:43:49+00:00

    Well, yes and no.

    VBA code stored in a text file and just open without downloading and run? No.

    But you can (download) open a workbook the same way as you open it from the local computer and run the macro using Application.Run

    Andreas.

    Was this answer helpful?

    0 comments No comments