Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Setting alignment in excel via vb .net

Hello -

I'm loading data from SQL Server 2000 via a web app written in
vb .net. I have no problem getting the data in the cells I want,
saving the excel file, and opening it in the browser. However, when I
try to format the cells, I'm getting this error:

"Public member 'XlVAlign' on type 'ApplicationClass' not found."

Here is the code I copied and pasted from examples I found online:
--
With excel.Range("A1", "D1")
.VerticalAlignment = excel.XlVAlign.xlVAlignCenter
End With
--
If it helps clarify anything, when I type in the line
".VerticalAlignment = excel." I don't have any options listed that
start with the letter "X".

I use the line
--
excel.Cells(rowIndex, colIndex).numberformat = "$#,##0.00"
--
and that works fine.

As I've said, the process worked great until I tried to pretty it up
by formatting.

Any help would be appreciated! If I am not including enough
information, or if this is not the appropriate group to post to,
please let me know.

Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Setting alignment in excel via vb .net

try using the value of the constant instead:

? xlVAlignCenter
-4108


--
Regards,
Tom Ogilvy


"dutchie" wrote:

Hello -

I'm loading data from SQL Server 2000 via a web app written in
vb .net. I have no problem getting the data in the cells I want,
saving the excel file, and opening it in the browser. However, when I
try to format the cells, I'm getting this error:

"Public member 'XlVAlign' on type 'ApplicationClass' not found."

Here is the code I copied and pasted from examples I found online:
--
With excel.Range("A1", "D1")
.VerticalAlignment = excel.XlVAlign.xlVAlignCenter
End With
--
If it helps clarify anything, when I type in the line
".VerticalAlignment = excel." I don't have any options listed that
start with the letter "X".

I use the line
--
excel.Cells(rowIndex, colIndex).numberformat = "$#,##0.00"
--
and that works fine.

As I've said, the process worked great until I tried to pretty it up
by formatting.

Any help would be appreciated! If I am not including enough
information, or if this is not the appropriate group to post to,
please let me know.

Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Setting alignment in excel via vb .net



Wow, that worked. Thanks!

This still makes me think I'm missing a reference to a dll or
something, which bothers me, but if I have to use the values I will.

Thanks again!

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
In Cell alignment, how do I update the default vertical alignment How to update default cell alignment Setting up and Configuration of Excel 2 February 4th 09 02:25 PM
Alignment Shrtcut Key For Excel. [email protected] Excel Discussion (Misc queries) 1 January 7th 09 07:04 AM
setting default cell virticle alignment WhiteCB Excel Discussion (Misc queries) 0 February 19th 07 03:31 PM
Excel cell alignment Sarbjit9122 Excel Worksheet Functions 0 July 8th 06 12:33 AM
default settings under alignment tab in Excel Larry Black Excel Discussion (Misc queries) 1 June 16th 05 11:43 PM


All times are GMT +1. The time now is 04:05 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"