 |
|
|
|
| Author |
Message |
Mark1110
Joined: 04 Oct 2007 Posts: 8
|
Posted: Mon Jun 06, 2005 9:15 pm Post subject: Setting a column width in excel |
|
|
I am trying to set various column widths in an excel spreadsheet from VB6. My
code is :
oExcelWorkSheet.Cells(iRowCounter, 1).Column.Width = 24
I am getting an error message. Is this the right syntax? If not, what will
work?
Thanks,
Mark
Archived from group: microsoft>public>vb>ole |
|
| Back to top |
|
 |
Jan Hyde
Joined: 04 Oct 2007 Posts: 1211
|
Posted: Tue Jun 07, 2005 1:13 pm Post subject: Re: Setting a column width in excel |
|
|
"Mark1110" 's wild
thoughts were released on Mon, 6 Jun 2005 17:15:01 -0700
bearing the following fruit:
>I am trying to set various column widths in an excel spreadsheet from VB6. My
>code is :
>
>oExcelWorkSheet.Cells(iRowCounter, 1).Column.Width = 24
>
>I am getting an error message. Is this the right syntax? If not, what will
>work?
>
Shall I use my crystal ball to determine the error message
or are you gonna tell us?
Jan Hyde (VB MVP)
--
Flan: whut dem birds is doin' over yo' head. (duh me)
[Abolish the TV Licence - http://www.tvlicensing.biz/] |
|
| Back to top |
|
 |
Mark1110
Joined: 04 Oct 2007 Posts: 8
|
Posted: Tue Jun 07, 2005 2:42 pm Post subject: Re: Setting a column width in excel |
|
|
The error message I am getting is Runtime error 424, Object Required. I am
not sure I am using the right syntax or not. Any help will be greatly
appreciated.
Also, when try to set the margins by using this statement it doesn't work.
oExcelWorkSheet.PageSetup.BottomMargin = 0.25
What happens is when I go into the worksheet, go to page setup and look at
the margins I get 0.0034. I tried making the margin a sting instead of a
number but that didn't have any effect on it.
Thanks,
Mark
"Jan Hyde" wrote:
> "Mark1110" 's wild
> thoughts were released on Mon, 6 Jun 2005 17:15:01 -0700
> bearing the following fruit:
>
> >I am trying to set various column widths in an excel spreadsheet from VB6. My
> >code is :
> >
> >oExcelWorkSheet.Cells(iRowCounter, 1).Column.Width = 24
> >
> >I am getting an error message. Is this the right syntax? If not, what will
> >work?
> >
>
> Shall I use my crystal ball to determine the error message
> or are you gonna tell us?
>
>
>
> Jan Hyde (VB MVP)
>
> --
> Flan: whut dem birds is doin' over yo' head. (duh me)
>
> [Abolish the TV Licence - http://www.tvlicensing.biz/]
>
> |
|
| Back to top |
|
 |
Jan Hyde
Joined: 04 Oct 2007 Posts: 1211
|
Posted: Wed Jun 08, 2005 1:21 pm Post subject: Re: Setting a column width in excel |
|
|
"Mark1110" 's wild
thoughts were released on Tue, 7 Jun 2005 10:42:02 -0700
bearing the following fruit:
>The error message I am getting is Runtime error 424, Object Required. I am
>not sure I am using the right syntax or not. Any help will be greatly
>appreciated.
>
>Also, when try to set the margins by using this statement it doesn't work.
>
>oExcelWorkSheet.PageSetup.BottomMargin = 0.25
>
>What happens is when I go into the worksheet, go to page setup and look at
>the margins I get 0.0034. I tried making the margin a sting instead of a
>number but that didn't have any effect on it.
0.25 points = 0.0034 inches
I guess what you want to set it to is 18 (points) so that
page setup shows .25 of an inch?
Would it be possible for you to post a short routine that
demonstrates the problems your having?
J
>Thanks,
>
>Mark
>
>
>
>
>"Jan Hyde" wrote:
>
>> "Mark1110" 's wild
>> thoughts were released on Mon, 6 Jun 2005 17:15:01 -0700
>> bearing the following fruit:
>>
>> >I am trying to set various column widths in an excel spreadsheet from VB6. My
>> >code is :
>> >
>> >oExcelWorkSheet.Cells(iRowCounter, 1).Column.Width = 24
>> >
>> >I am getting an error message. Is this the right syntax? If not, what will
>> >work?
>> >
>>
>> Shall I use my crystal ball to determine the error message
>> or are you gonna tell us?
>>
>>
>>
>> Jan Hyde (VB MVP)
>>
>> --
>> Flan: whut dem birds is doin' over yo' head. (duh me)
>>
>> [Abolish the TV Licence - http://www.tvlicensing.biz/]
>>
>>
Jan Hyde (VB MVP)
--
God made the integers; all else is the work of Man.
Kronecker
[Abolish the TV Licence - http://www.tvlicensing.biz/]
|
|
| Back to top |
|
 |
|
|
| Related Topics: | Column Names VB.net Hi, Could someone point me in the right direction. I want to dynamically create a table and assign the column names as [Name(1)], [Name(2)] [Name(3)] etc. with square brackets. My code does this ok, but once the brackets are there I cannot get insert, up
replace Excel 2000 -> Excel 2003 I am using the following code to edit data cell by cell: What:="", I get a Microsoft error "Microsoft Excel cannot find any data to replace. Check if your search formatting and criteria are defined correctly. I
Excel chart from VB to Excel Hi I've a Chart object in a VB6 form together with some text boxes, my question is can I "copy" the chart object from the form and place it in a Excel chart ?? I know I can create the chart in a Excel my question is can I
Excel I am a bit of an expert at programming, but a beginner at VB. I have VB6.0 and I cannot seem to figure out just how to get information from Excel. I just want to write a simple program that can read Excel documents and write them out as text files. We
Excel and OLE Is there any way to take an Excel object, whether it be a chart object or range, and connect it to an OLE control to show the object? For instance, if I had: Dim objApp As Dim objBooks As Dim range As Excel.range Dim objS |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|