Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Setting Print options from a VB6 program

I am not sure if this is the correct place to post this or not but here goes.

I have been doing some programming to take information from an Access
database, massaging it and putting it in an Excel spreadsheet. The
programming overwrites the file each time.

I have done some formatting eg. Bolding, Autofit, horizontal alignment, and
in some projects I have put in some Sum formulas.

My client is now asking for specific printing formatting options that are
normally setup after the information gets to the spreadsheet. The list is
below but I have no idea where to even begin looking for information on
these. Basically once the spreadsheet is setup and opened, they want the
settings below predone. Since I am overwriting the file each time these
formatting options are also overwritten.

I have found a couple of references to some printing options but they don't
all seem to work as expected. For example, I am trying to set the gridlines
to show with

ExcelSheet.PageSetup.PrintGridlines = True

This seems to work ok but when I try to set the pages to 1 page wide by
whatever tall I don't get what I want. It continues to expand past the page
but does not show the remaining columns that do not show on the first page
and I get many copyies of the same pages.

ExcelSheet.PageSetup.FitToPagesWide = 1

I am trying to set the first row to print on every page but it does not seem
to be working either. I would prefer to just say Row A and all of them show:

ExcelSheet.PageSetup.PrintTitleColumns = "$A:$CZ"

1. Landscape orientation
2. Legal size paper
3. 0.2" margins, except bottom edge @ 0.75"
4. Footer: Left - Date & time printed; Centre - Name of Show; Right -Page#
of #pages
5. Fit to print 1 page wide by however many pages long
6. Gridlines
7. Repeat header row on every page

One to add is how to set the Freeze Panes? I usually can tell in the code
what the cell would be if I were to do it manually but am not sure about what
function to use.

TIA rasinc
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Setting Print options from a VB6 program

Ras,

I was searching for similar but thru VBA ...
Following example was in the Help...DON'T IGNORE ".zoom = False" :
Hope it helps ...

This example causes Microsoft Excel to print Sheet1 exactly one page
wide and tall.

With Worksheets("Sheet1").PageSetup
.Zoom = False
.FitToPagesTall = 1
.FitToPagesWide = 1
End With

JimP

rasinc wrote:
I am not sure if this is the correct place to post this or not but here goes.

I have been doing some programming to take information from an Access
database, massaging it and putting it in an Excel spreadsheet. The
programming overwrites the file each time.

I have done some formatting eg. Bolding, Autofit, horizontal alignment, and
in some projects I have put in some Sum formulas.

My client is now asking for specific printing formatting options that are
normally setup after the information gets to the spreadsheet. The list is
below but I have no idea where to even begin looking for information on
these. Basically once the spreadsheet is setup and opened, they want the
settings below predone. Since I am overwriting the file each time these
formatting options are also overwritten.

I have found a couple of references to some printing options but they don't
all seem to work as expected. For example, I am trying to set the gridlines
to show with

ExcelSheet.PageSetup.PrintGridlines = True

This seems to work ok but when I try to set the pages to 1 page wide by
whatever tall I don't get what I want. It continues to expand past the page
but does not show the remaining columns that do not show on the first page
and I get many copyies of the same pages.

ExcelSheet.PageSetup.FitToPagesWide = 1

I am trying to set the first row to print on every page but it does not seem
to be working either. I would prefer to just say Row A and all of them show:

ExcelSheet.PageSetup.PrintTitleColumns = "$A:$CZ"

1. Landscape orientation
2. Legal size paper
3. 0.2" margins, except bottom edge @ 0.75"
4. Footer: Left - Date & time printed; Centre - Name of Show; Right -Page#
of #pages
5. Fit to print 1 page wide by however many pages long
6. Gridlines
7. Repeat header row on every page

One to add is how to set the Freeze Panes? I usually can tell in the code
what the cell would be if I were to do it manually but am not sure about what
function to use.

TIA rasinc


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Setting Print options from a VB6 program

Thanks Jim,

I found that was the problem last week. I had done everything exceopt the
..zoom statement. Appreciate the response.

"JimP" wrote:

Ras,

I was searching for similar but thru VBA ...
Following example was in the Help...DON'T IGNORE ".zoom = False" :
Hope it helps ...

This example causes Microsoft Excel to print Sheet1 exactly one page
wide and tall.

With Worksheets("Sheet1").PageSetup
.Zoom = False
.FitToPagesTall = 1
.FitToPagesWide = 1
End With

JimP

rasinc wrote:
I am not sure if this is the correct place to post this or not but here goes.

I have been doing some programming to take information from an Access
database, massaging it and putting it in an Excel spreadsheet. The
programming overwrites the file each time.

I have done some formatting eg. Bolding, Autofit, horizontal alignment, and
in some projects I have put in some Sum formulas.

My client is now asking for specific printing formatting options that are
normally setup after the information gets to the spreadsheet. The list is
below but I have no idea where to even begin looking for information on
these. Basically once the spreadsheet is setup and opened, they want the
settings below predone. Since I am overwriting the file each time these
formatting options are also overwritten.

I have found a couple of references to some printing options but they don't
all seem to work as expected. For example, I am trying to set the gridlines
to show with

ExcelSheet.PageSetup.PrintGridlines = True

This seems to work ok but when I try to set the pages to 1 page wide by
whatever tall I don't get what I want. It continues to expand past the page
but does not show the remaining columns that do not show on the first page
and I get many copyies of the same pages.

ExcelSheet.PageSetup.FitToPagesWide = 1

I am trying to set the first row to print on every page but it does not seem
to be working either. I would prefer to just say Row A and all of them show:

ExcelSheet.PageSetup.PrintTitleColumns = "$A:$CZ"

1. Landscape orientation
2. Legal size paper
3. 0.2" margins, except bottom edge @ 0.75"
4. Footer: Left - Date & time printed; Centre - Name of Show; Right -Page#
of #pages
5. Fit to print 1 page wide by however many pages long
6. Gridlines
7. Repeat header row on every page

One to add is how to set the Freeze Panes? I usually can tell in the code
what the cell would be if I were to do it manually but am not sure about what
function to use.

TIA rasinc



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
Works Spreadsheet Options shuts down the program RV Camper Excel Discussion (Misc queries) 1 October 7th 08 07:58 PM
Setting print options globally ? tcurrier Excel Discussion (Misc queries) 1 February 20th 06 09:48 PM
How to set DEFAULT print options in Excel to print gridlines? LKR Excel Discussion (Misc queries) 1 September 23rd 05 06:16 PM
Setting Printer Options Programmatically Chaplain Doug Excel Programming 0 December 16th 04 09:35 PM
Options for three compartment analysis - Old BASIC program to Excel? Tanya Falbel Excel Programming 0 October 18th 04 09:30 PM


All times are GMT +1. The time now is 10:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"