Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Vb.net Freeze Pane In Excel


  • Please log in to reply
5 replies to this topic

#1 RADIUM-V Interactive

RADIUM-V Interactive

  • Members
  • 159 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Somewhere East of Where You Are (think about it)
  • Local time:11:53 AM

Posted 12 March 2008 - 05:59 PM

So here's the situation. I'm pulling data from SQL and putting it into an Excel Sheet. I want to control formatting, and I want to be able to freeze a specific row when scrolling. I've seen some examples, but they're either for an older version of VB or an older version of Office (of which I'm using Ultimate 2007).

Are there any controls to use? Any help will be greatly appreciated.

Thanks,
John

BC AdBot (Login to Remove)

 


#2 sheril

sheril

  • Members
  • 1 posts
  • OFFLINE
  •  
  • Local time:11:53 AM

Posted 19 April 2008 - 02:43 AM

while you writing u can format the page.

follow this and check it

http://vb.net-informations.com/excel-2007/...page_format.htm

#3 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:10:53 AM

Posted 19 April 2008 - 08:51 AM

When you have your spreadsheet open in Excel, highlight the row or columns that you want frozen. Click the view tab at the top. In the Windows section of the ribbon is an option to 'freeze panes'. Click on that, and select the first option to freeze what you selected. Click it again to unfreeze the panes.

#4 RADIUM-V Interactive

RADIUM-V Interactive
  • Topic Starter

  • Members
  • 159 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Somewhere East of Where You Are (think about it)
  • Local time:11:53 AM

Posted 20 April 2008 - 01:03 PM

When you have your spreadsheet open in Excel, highlight the row or columns that you want frozen. Click the view tab at the top. In the Windows section of the ribbon is an option to 'freeze panes'. Click on that, and select the first option to freeze what you selected. Click it again to unfreeze the panes.



See, that would work, but I'm creating each spreadsheet from scratch in VB.NET. I need to be able to make the panes frozen with code control, not actually going to the sheet and doing it. The whole thing is automated, including this.

#5 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:10:53 AM

Posted 20 April 2008 - 03:57 PM

Something like this?
Dim wb As Excel.Workbook
		Dim ex As New Excel.Application
		wb = ex.Workbooks.Add
		Dim sheet As Excel.Worksheet = wb.Worksheets.Add
		' Select the row above of what you want to freeze
		sheet.Rows(2).Select()
		sheet.Application.ActiveWindow.FreezePanes = True
		ex.Visible = True

I nabbed that from Experts Exchange.

#6 RADIUM-V Interactive

RADIUM-V Interactive
  • Topic Starter

  • Members
  • 159 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Somewhere East of Where You Are (think about it)
  • Local time:11:53 AM

Posted 02 May 2008 - 04:12 PM

I was hoping I didn't have to go that route, with physically selecting the area. Oh well, at least it's not as bad as adding a Totals rows to the end of the data like I have to anyway. Hail Groovicus!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users