VBA connected vs disconnected from network?

T

TSW632

Cross posted from Excel.Programming

Anyone know why some code would work fine when not plugged into my
company’s LAN, but not when I am plugged into the LAN? I mean, other
than Macro Security, is there something else I should be checking?
The
Macro Security shows medium in either condition, but the code will
not
work when I am on the LAN… And while I'm here, anyone know what to
change in NumberFormat so a
currency symbol will be displayed with negative figures as well as
positive?

Thanks, Troy

Here is the code:

Private Sub Worksheet_Calculate()
Const CURRENCYTYPES As String = ":GBP£:JPY¥:EUR€:USD$:CAD$:MEX$:BRL
$:"
Static pv As Variant
Dim cv As Variant


cv = Me.Range("V35").Value2


'unless the current value (cv) is a 4-char string different than
the
cached
'previous value (pv), there's nothing to do, so exit quickly
If cv = pv Or VarType(cv) <> vbString Or Len(CStr(cv)) <> 4 Then
Exit Sub
Else
cv = ":" & cv & ":"
End If


If InStr(1, CURRENCYTYPES, cv, vbTextCompare) > 0 Then
Me.Range("F49:AF49").NumberFormat = Mid$(cv, 5, 1) & "_([$ -2] *
#,##0_);_([$ -2] * (#,##0);_([$ -2] * ""-""_);_(@_)"
pv = Mid$(cv, 5, 1)
End If
End Sub
 
A

Argy - Arcasoft

HI;
These factors have to be checked:
1- That users pulling or using the macro have, LOW macro protection in their
local excels. You can control this in the programing by changing their
security on their setting and re-stating it once the application has been
exitted.
2- Try to create a digital signature for your application. I think that this
signature has to be accepted in each computer or user that runs this macro.
The good thing about it, is that as far as I know, once you are a valid
recognized and save macro creator, Window and Excel will not stop you to run
that macro in any computer that aknowledge you as a good source.

Good luck

Argy
 

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