Share via

Can an excel function call subroutine

Anonymous
2011-06-21T18:02:33+00:00

After an exhaustive search, I am unable to find the answer to my question. I have a spreadsheet where the user wants to use macros to populate a sheet with data accessed from a web service. Accessing a single data element works fine. However, I need to bring in a list of data. For some history, I have developed a C# solution using ribbon code that displays the data from service without issue.

As stated earlier, the requester is asking for a macro to display the list of data. I know can use a Subroutine to access the data via Function. So in other words, I can run the sub then have the sub call the function to bring in the variant and populate the cells. What I believe I need is a function that can pass the variant to a sub to display the data. In that way I can use UDF to display the data. From what I can tell, you cannot call a subroutine from a function. I just need to know what the rules are governing the calls.

First let me say sorry for this verbose question but I needed to be clear over a cryptic question.

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

1 answer

Sort by: Most helpful
  1. Anonymous
    2011-06-21T18:19:02+00:00

    You are asking for an event code.

    See Chip Pearsons site for further information; http://www.cpearson.com/excel/Events.aspx

    Was this answer helpful?

    0 comments No comments