Design question

R

Ray

Thanks to all who support this forum - I've learned so much just by
reading the posts....

I have a custom function that works nicely and is really powerful
called sku_info()
It calls a function on another server in another application to
retrieve attributes of a sku.

However the remote server isn't always available. I'd like the
function to be able to exit without changing the values from the last
time it was executed successfully.

I'd also like to be able to control when the formulas are refreshed
because they can be time consuming. My thought was to put a macro
button on the toolbar to set a global flag "gb_connected" when it is
connected, refresh the spreadsheet, and then set the flag to false.

However, the

Currently, I exit the function if the remote system is not connected
like this:


Function skuinfo(p_input As Variant, p_func As String) As Variant
If Not gb_connected Then
Exit Function
End If
skuinfo = remotefunctioncall(p_input,p_func,0)
end function


I'm guessing the flaw is in my design rather than my code? There is
no way to exit a function without setting the returned value to zero?
I don't mind triggering this with a macro/sub but how would I do this?

Thanks for any suggestions you may have.
Ray

What if I controlled the whole process from
 
M

Malik

Open EXCEL Sheet:

Goto Tools -->Options --> Calculation --> Change from Automatic to Manul

Then you can add a toolbar and it's code to connect and refresh

In othercases, you can simply press F9 to refresh every calculated value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top