Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
W

Wheels012

@Wheels012
About
Posts
118
Topics
39
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Issues with using C# library in Excel 2007 VBA
    W Wheels012

    It has been a while since I created the code, and I don't recall why I took that approach, but I can give the UsedRange 'method' a try. Thank you for your reply. WHEELS

    C# testing csharp beta-testing tools

  • Issues with using C# library in Excel 2007 VBA
    W Wheels012

    Good morning. I have created a library of functions in C#, and I am testing them to see if they work in both VBA and on a spreadsheet (I am ok if they only work in VBA). I have C# code to display the LastColumn and the LastRow in a spreadsheet as follows:

    ///
    /// Finds the last column on a worksheet.
    ///
    ///
    ///
    public string FindLastColumn(Worksheet xlWorkSheet)
    {
    int nInLastCol = 0;

    // Find the last real column
    nInLastCol = xlWorkSheet.Cells.Find("*", System.Reflection.Missing.Value, System.Reflection.Missing.Value,
    System.Reflection.Missing.Value, XlSearchOrder.xlByColumns,XlSearchDirection.xlPrevious,
    false,System.Reflection.Missing.Value,System.Reflection.Missing.Value).Column;

    return GetExcelColumnName(nInLastCol);
    }

    ///
    /// Converts the column # to the corresponding letter.
    ///
    ///
    ///
    private string GetExcelColumnName(int columnNumber)
    {
    int dividend = columnNumber;
    string columnName = String.Empty;
    int modulo;

    while (dividend > 0)
    {
    modulo = (dividend - 1) % 26;
    columnName = Convert.ToChar(65 + modulo).ToString() + columnName;
    dividend = (int)((dividend - modulo) / 26);
    }

    return columnName;
    }

    ///
    /// Finds the last row on a worksheet.
    ///
    ///
    ///
    public long FindLastRow(Worksheet xlWorkSheet)
    {
    long nInLastRow = 0;

    // Find the last real row
    nInLastRow = xlWorkSheet.Cells.Find("*", System.Reflection.Missing.Value,
    System.Reflection.Missing.Value, System.Reflection.Missing.Value,
    XlSearchOrder.xlByRows,XlSearchDirection.xlPrevious,
    false,System.Reflection.Missing.Value,System.Reflection.Missing.Value).Row;
    return nInLastRow;
    }

    The FindLastColumn code works in VBA, but the FindLastRow does not, and neither works on a sheet (not sure how to correctly pass in the current sheet). The error is: Function or interface marked as retricted, or the function uses an Automation type not supported in Visual Basic. VBA:

    Dim TSExcelLib As New TechSolutionsXLLibrary.ExcelFunctions

    Private Sub CommandButton1_Click()

    MsgBox TSExcelLib.FindLastColumn(Sheets("Sheet1")) 'Works
    MsgBox TSExcelLib.FindLastColumn(Sheet1) 'Works

    MsgBox TSExcelLib.FindLastColumn(Sheets("Sheet1")) 'Doesn't work
    MsgBox TSExcelLib.FindLastColumn(Sheet1) 'Doesn't work

    C# testing csharp beta-testing tools

  • Reading connection string from App.config using LINQ
    W Wheels012

    That is a good idea. I'll give it a shot. Thank you.

    Managed C++/CLI database csharp sql-server linq sysadmin

  • Reading connection string from App.config using LINQ
    W Wheels012

    Good morning. I am having a challenge deriving a connection string from my App.config. It is laid out for a special way of connection to SQL Server and Teradata, and using AppSettings is not possible. I would like to query for the value using LINQ or Lamda, but I don't have a great deal of experience in either.

    Managed C++/CLI database csharp sql-server linq sysadmin

  • Adding a hyperlink to a sentence of text in a bulleted list
    W Wheels012

    Thanks for the help. We'll keeping working on it after the weekend.

    C# help tutorial question

  • Adding a hyperlink to a sentence of text in a bulleted list
    W Wheels012

    The bullet rendered, but nothing else.

    C# help tutorial question

  • Adding a hyperlink to a sentence of text in a bulleted list
    W Wheels012

    What property do I use in liBullet? There doesn't seem to be a text property, and innertext didn't work.

    C# help tutorial question

  • Adding a hyperlink to a sentence of text in a bulleted list
    W Wheels012

    I have to declare the* id, and protected System.Web.UI.WebControls.ListItem liBullets; is incorrect. That appears to be reserved for drop-down or list boxes. I'm not sure what type the

    • is to be decalred as.
    C# help tutorial question

  • Adding a hyperlink to a sentence of text in a bulleted list
    W Wheels012

    protected System.Web.UI.WebControls.ListItem liBullets;

    private const string BULLETTHREELBHL = "Employee earnings can be submitted through the <a href=\"/EECHG/FW_DEFAULT.ASPX?Serviceid=EECHG&title=Employee+Changes\">Employee Changes</a> service by a plan administrator with access to update employee changes.";

    this.liBullets.Text = BULLETTHREELBHL;

    <ul>
    <li id="liBullets" />
    <li>To Access Google, click <a href="http://google.com">here</a></li>
    <li><a href="http://bing.com">This</a> takes you to Bing</li>
    </ul>

    C# help tutorial question

  • Adding a hyperlink to a sentence of text in a bulleted list
    W Wheels012

    When I dynamically populate the .text property, I get an Object reference not set to an instance of an object error. System.NullReferenceException.

    C# help tutorial question

  • Adding a hyperlink to a sentence of text in a bulleted list
    W Wheels012

    <ul>
    <li id="liBullet" />
    <li><a href="http://bing.com">This</a> takes you to Bing</li>
    </ul>

    C#

    protected System.Web.UI.WebControls.ListItem liBullet;
    this.liBullet.Attributes.Add(BULLETTHREELBHL);
    private const string BULLETTHREELBHL = "Employee earnings can be submitted through the <a href=\"/EECHG/FW_DEFAULT.ASPX?Serviceid=EECHG&title=Employee+Changes\">Employee Changes</a> service by a plan administrator with access to update employee changes.";

    WHEELS

    C# help tutorial question

  • Adding a hyperlink to a sentence of text in a bulleted list
    W Wheels012

    It seems to work well in the .aspx, but now I have to put it in as a dynamic variable. Is there any issue with including the a href in the string? WHEELS

    C# help tutorial question

  • Adding a hyperlink to a sentence of text in a bulleted list
    W Wheels012

    Sorry Shameel. I was not entirely clear. I have done that sucessfully, but what I am looking for is the following: * This is an example of programming. Then when you click the underlined word good it takes you to http://www.codeproject.com. * is a bullet. WHEELS

    C# help tutorial question

  • Adding a hyperlink to a sentence of text in a bulleted list
    W Wheels012

    I had to abandon the Common control approach. I added a simple BulletedList to the .aspx file, but I am still having a very challenging time setting a hyperlink on a given word in a bullet sentence. I am starting to believe this can't be done. There are three DisplayMode options for a BulletedList: Text, HyperLink, and ImageButton, but no Text/Hyperlink combo. If you have time can you try to create one that does what I am looking for? Thanks, WHEELS

    C# help tutorial question

  • Adding a hyperlink to a sentence of text in a bulleted list
    W Wheels012

    Hi Shameel. The text renders correctly when set up as a label directly on the page. I believe you are correct about the encoding issue. Is there a way to decode? WHEELS

    C# help tutorial question

  • Adding a hyperlink to a sentence of text in a bulleted list
    W Wheels012

    Thanks Bob and Shameel. We had done some modifications to this code and when we put it back, we must have put the syntax back incorrectly. Unfortunately after fixing the code, it still renders as text. WHEELS

    C# help tutorial question

  • Adding a hyperlink to a sentence of text in a bulleted list
    W Wheels012

    Hi Bob. What should they be? WHEELS

    C# help tutorial question

  • Adding a hyperlink to a sentence of text in a bulleted list
    W Wheels012

    private const string BULLETTHREELBHL = "This is an example of the hyperlink <a href=\"/../Test/FW_DEFAULT.ASPX?Serviceid=Test&title=Test+Page>Test Page\"</a> where people click to navigate to another page.";

    C# help tutorial question

  • Adding a hyperlink to a sentence of text in a bulleted list
    W Wheels012

    Good afternoon. We created a control (somecontrol.cs) which displays a dynamic bullet list. In some scenerios, one of the bullets will have a hyperlink. The problem is, the a href code renders as text. We are adding to a string List and using it as the DataSource for the bulleted list:

    private BulletedList _blConfirmText = new BulletedList();
    List<string> displayText = new List<string>();
    _confirmText.Text = CONFIRMTEXTLB;
    displayText.Add(BULLETONELB);
    displayText.Add(BULLETTWOLB);

                    if (hasUpdateAccess)                    
                        displayText.Add(BULLETTHREELBHL);                          
                    else
                        displayText.Add(BULLETTHREELB);
    

    //set the bullet style and load the bulletd list
    _blConfirmText.CssClass = "bulletItems";
    _blConfirmText.DataSource = displayText;
    _blConfirmText.DataBind();

    Any idea how to get this to render correctly? Any suggestions? Thank you, WHEELS

    C# help tutorial question

  • C# XML Query Website address based on Website name
    W Wheels012

    Excellent. That does the trick. Thank you.

    XML / XSL csharp database com xml question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups