Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel
external usenet poster
 
Posts: 14
Default VBA connected vs disconnected from network?

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
  #2   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel
external usenet poster
 
Posts: 39
Default VBA connected vs disconnected from network?

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

"TSW632" wrote:

Cross posted from Excel.Programming

Anyone know why some code would work fine when not plugged into my
companys 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
disconnected chart objects KenRogers Charts and Charting in Excel 0 August 5th 08 08:03 PM
TWO CUSTOM FUNCTIONS NOT BEING CONNECTED FARAZ QURESHI Excel Discussion (Misc queries) 0 January 26th 08 08:21 PM
hangs when connected Gerhard Adendorff Excel Discussion (Misc queries) 0 April 13th 07 06:56 AM
Excel - let search for more than one disconnected word in a cell Milinds Excel Worksheet Functions 1 January 30th 06 11:20 PM
Excel runs slowly, but only when connected to a network Pete Excel Discussion (Misc queries) 3 November 28th 05 08:25 PM


All times are GMT +1. The time now is 10:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"