Skip to content

Instantly share code, notes, and snippets.

View aduguid's full-sized avatar
🏠
online

Anthony aduguid

🏠
online
View GitHub Profile
/// <summary>
/// This will create a temporary file in Unicode text (*.txt) format, overwrite the current loaded file by replaing all tabs with a comma and reload the file.
/// </summary>
/// <param name="force">To force save the current file as a Unicode CSV.
/// When called from the Ribbon items Save/SaveAs, <i>force</i> will be true
/// If this parameter is true and the file name extention is not .csv, then a SaveAs dialog will be displayed to choose a .csv file</param>
/// <param name="newFile">To show a SaveAs dialog box to select a new file name
/// This will be set to true when called from the Ribbon item SaveAs</param>
public void SaveAsUnicodeCSV(bool force, bool newFile)
Public Sub DeleteChosenNames()
'---------------------------------------------------------------------------
'Purpose:  Remove ALL named ranges from worksheet with user's approval
'---------------------------------------------------------------------------
On Error GoTo ErrTrap
Dim nName   As Name
Dim lReply  As Long

    For Each nName In Names
@aduguid
aduguid / VisualStudio.CommandWindow.DiffFiles.md
Last active December 19, 2017 04:46
Visual Studio - Command Window - Diff Files
>Tools.DiffFiles "C:\Temp\old.sql" "C:\Temp\new.sql"
' Put this code into FileName.rss and then
'   execute with: rs -i FileName.rss -s ServerName/ReportServer
' Originally from http://social.msdn.microsoft.com/Forums/en/sqlreportingservices/thread/a2a9ebe1-0417-46bf-8589-ae4e4a16181c   in a post by Igor Gelin
' Additional fields from http://msdn.microsoft.com/en-us/library/reportservice2005.datasourcedefinition.aspx added.
'  This appears to ONLY work for Shared data sources, not Custom data source or embedded data source (i.e. per-report data sources)
Public Sub Main()
  Dim items As CatalogItem() = Nothing
  Dim dataSource As DataSourceDefinition
  Dim count as Integer = 0
Public Sub DisplayMessage( _
ByVal procedure As String, _
ByVal module As String, _
errNbr As Double, _
errDes As String, _
Optional ByVal errLine As Variant = 0, _
Optional ByVal title As String = "Unexpected Error")
'--------------------------------------------------------------------------------------------------------------------
' Purpose:  Global error message for all procedures
Public Sub PrintEnvironmentVariables()
On Error Resume Next
Dim strVar  As String
Dim i       As Long

    For i = 1 To 255
        strVar = Environ$(i)
        If LenB(strVar) = 0& Then Exit For
 Debug.Print strVar
  Public Function IsMember( _
  domainName As String _
, groupName As String _
, memberName As String) As Boolean
On Error GoTo ErrTrap
Dim grp As Object
Dim pathName As String

 pathName = "WinNT://" &amp; domainName &amp; "/"
Public Sub SetCustomProperties( _
  propertyName As String _
, propertyValue As Variant _
, Optional propertyType As Office.MsoDocProperties = msoPropertyTypeString _
, Optional linkToContent As Boolean = False _
, Optional linkSource As Variant)
'--------------------------------------------------------------------------------------------------------------------
' Purpose:   Global error message for all procedures
' Example:   Call SetCustomProperties("ReleaseDate", "04-Oct-2017 4:25pm", msoPropertyTypeDate, False)
@aduguid
aduguid / GITHUB.HtmlTags
Last active September 19, 2017 01:08
GITHUB.HtmlTags
<a>
<b>
<blockquote>
<br>
<code>
<dd>
<del>
<details>
<div>
<dl>
@aduguid
aduguid / SSRS.heatmap_example.md
Last active October 30, 2017 01:57
ssrs.heatmap_example
Public Function HeatMapColorGradate( _
  ByVal Value As Double _
, ByVal MaxPositive As Double _
, ByVal Neutral As Double _
, ByVal ColStr As String) As String
'------------------------------------------------------------------------------------------------
' Purpose:  To use a color gradations on a heatmap report
' Example:  BackgroundColor =Code.HeatMapColorGradate(25, 100, -10, Variables!ColorEventCountGradate.Value)
'           BackgroundColor =Code.HeatMapColorGradate(dayValue, maxValue, 0, "#2322EE")