Arrow keys don't work in excel

by ebarcza 6/1/2011 12:28:00 PM
If your arrows keys don't move you from cell to cell anymore hit the scroll lock key once

Tags:

Excel Programming

Export ListView to Excel

by jrose 8/20/2010 10:02:00 AM

All results that I came across when performing a search for export listview to excel were related to instances of Windows.Forms.ListView and not System.Web.UI.WebControls.ListView.

 

Attached are the two functions necessary to export instances of System.Web.UI.WebControls.ListView to Excel.

public override void VerifyRenderingInServerForm(Control control) { }

protected void btnExport_Click(object sender, EventArgs e)
{
    Response.Clear();
    Response.Buffer = true;
    Response.ContentType = "application/vnd.ms-excel";
    Response.Charset = "";
    this.EnableViewState = false;
    StringWriter stringWriter = new StringWriter();
    HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter);
    listView.RenderControl(htmlTextWriter);
    Response.Write(stringWriter.ToString());
    Response.End();
}

Tags: , , ,

.NET | ASP.NET AJAX | Excel Programming

Canceling Application.Ontime in excel

by ebarcza 9/16/2009 5:43:00 AM

So I'm a little new with excel, but programming in VBA is fun so I took on a little project involved consuming data from a webservice. The workflow went like this:

  1. Poll web service
  2. Drop new records in designated named range
  3. Run again in 30 seconds

I scheduled a subroutine to perform this using Application.Ontime. The problem was, when i closed the workbook, it kept on opening the workbook back up. So I had to figure out a way to cancel the scheduled subroutine. You do this by setting schdeule=false, but you have to pass in the same time that it was schedule for in the earliest time param. Here's how you do it:

 

Public RunWhen As Double - I put this in a module called mPublic 

Private Sub Workbook_Open()
    Time_set
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Bye_Bye
End Sub

Sub Time_set()
    RunWhen = Now + TimeValue("00:00:30")
    Application.OnTime RunWhen, "time_set"   
    DoWork

End Sub 

Sub Bye_Bye()
     Application.OnTime EarliestTime:=RunWhen, Procedure:="time_set", Schedule:=False

End Sub

Rate this post to let me know if it actually helped anyone!

 

 

Tags:

Excel Programming

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  November 2017  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Recent comments

Tags

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017

Sign in