Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Fit To One Page (MS Excel)

Does any body know why this code will not work. Their are no errors.
The code is executed it just does not work.

With .PageSetup
.FitToPagesWide = 1
.FitToPagesTall = 1

End With

This with is within another with which includes the Excel spread sheet

Edit. I can manually goto the Page Setup and fit it to one page, it will work this way. Just not from my program

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Creating Master Excel File From Many One Page Excel Files
I am using VB6 and am able to create a master excel file of Teaching schedules by getting all files in a specific directory that start with S2004. Starting with line 26 (MaxTimes = 11 represents time slots from 8a to 10p at night, increments of 1 hr 15 min classes) is a synopsis of the classes that an instructor will be teaching. So far I can create a single sheet in the master file from all the other schedules. What I would like to do is add a copy of the individual schedules into the master file. So, Master Sheet 1 (named 'MASTER') will still contain the synopsis. Master Sheet 2 will be a copy of Person#1's schedule (named for that person), Master Sheet 3 will be a copy of Person#2's schedule (named for that person), etc. My attempt below is not working. Please help. Thanks.

Private Sub CreateMasterSchedule_Click()
Dim Filename As String, Path As String
Dim Workbook, WorkbookAll As Workbook
Dim Worksheet, WorksheetAll As Worksheet
Dim Row As Integer, RowAll As Integer, i As Integer, j As Integer
Dim SheetNumber As Integer

'create MASTER file composed of individual schedule data
Set ExcelAll = New Excel.Application
Set WorkbookAll = ExcelAll.Workbooks.Add
Set WorksheetAll = WorkbookAll.ActiveSheet
WorksheetAll.Name = "MASTER"
RowAll = 1
SheetNumber = 2

Dialog1.Label1 = "Loading..."

' Workbook.Worksheets.Add
' Set Worksheet = Workbook.ActiveSheet

Path = "c:"
Filename = Dir(Path)
Do While Filename <> ""
If Mid(Filename, 1, 6) = "S2004_" Then
'get data from files
Set Excel = New Excel.Application
Set Workbook = Excel.Workbooks.Open(Path + Filename)
Set Worksheet = Workbook.ActiveSheet
' WorkbookAll.Sheets(SheetNumber).Select
Dialog1.Label1 = Dialog1.Label1 + Chr(10) + "Processing " + Path + Filename + "..."
Row = 1
'offset of 3 accounts for two rows at top (Name, Days) and space row between last time slot and row data
Do While Worksheet.Rows.Cells(2 * MaxTimes + 3 + Row, 1) <> ""
For i = 1 To 12
'preserve date format as 03/14/98 instead of 34768
If i = 9 Or i = 10 Then
WorksheetAll.Rows.Cells(RowAll, i) = CStr(Worksheet.Rows.Cells(2 * MaxTimes + 3 + Row, i))
WorksheetAll.Rows.Cells(RowAll, i) = Worksheet.Rows.Cells(2 * MaxTimes + 3 + Row, i)
End If
Next i
Row = Row + 1
RowAll = RowAll + 1
'copy schedule onto another sheet in the MASTER file
' WorkbookAll.Worksheets.Add
'I haven't figured out how to select and copy the entire sheet yet
' For i = 1 To Row
' For j = 1 To 12
' WorksheetAll.Rows.Cells(i, j) = Worksheet.Rows.Cells(i, j)
' Next j
' Next i
' WorksheetAll.Name = Mid(Filename, 6)
'change back to MASTER list sheet to add next faculty's info
' SheetNumber = SheetNumber + 1
' WorkbookAll.Sheets(1).Select
'close faculty file
Call Workbook.Close(False)
Set Excel = Nothing
End If
Filename = Dir() ' Get next entry.
WorksheetAll.Cells.Sort Key1:=Range("A1:L" + CStr(RowAll))
' WorksheetAll.Cells

WorkbookAll.SaveAs ("c:Documents and SettingscegDesktopMASTER")
Call WorkbookAll.Close(False)
Set ExcelAll = Nothing

End Sub

"Excel Caused An Invalid Page Fault In Module Excel.exe"
I wrote some code for an excel file: if you click a button, the file is saved, it reads the name for the file from a particular cell. This worked excellent. I didn't used tis file for quite a while and now when I wanted to use it again, it asks me to install the autocorrection lists. I did this, worked a bit and saved the file with my button. Now when I want to open the saved file, I get this error, I have the complete error, but that's just some registry values, you can't see anything in that The weird part is that all other excel files work great, except the ones that were made with my code.

Word - Loop Through Each Page In Document And Copy Page With Page Format
Here's what i'm trying to accomplish

1 - Start at first page and get page format (portrait/landscape)

2 - Copy page and paste it into a new word document with original format

repeat these steps until all pages have been copied

I need the condition where a document has both portrait and landscape pages.

Anyhelp would be appreciated

Web Page To Excel
Hello all!

I am trying to write a VBA program that goes to a website, searches for data located on the page, and extracts that information to an excel sheet.

Any ideas?


- Aerosoob

Next Page In Excel
I tried to run a macro that would tell me how to implement a page break in Excel and got this:

VB Code:
objExcel.ActiveSheet.HPageBreaks.Add Before:=Rows(RowNum + 1 & ":" & RowNum + 1)

but it's not working. I get an application or user-defined error. Can someone tell me how I can programmatically go to the next page in Excel or insert a pagebreak? Thanks, Jeremy

Excel Page Set Up From VB 6
Hello Friends

I need to print some report in Excel sheet which
page set up need to be adjusted thorough code.

Now I need to know How Can I set Scaling option of Print Dialog to 85 %

Please Refer to Print Dialog Box opeing an Excel sheet.

With regards


Excel In A Web Page
sorry about my english

I have a Web Page and I use a Excel.Application Object

i want recovery a chart. I use a chart object and i have any problem, but if this chart is group with other image haven't recovery.

How i do?

First Row Of An Excel Page
Just so we talk about the same thing: an Excel workbook includes worksheets and in an Excel worksheet, there are pages. I would like to know if it is possible to detect the first row of a page. For examle: page1-row1, page2-row27, ...
I don't know if there is an excel shortcut that allows the user to be positionned on the first row of a new page. I could then do var=activecell.row
I hope im clear...

Excel Page Break
hoi !

anybody know of a way to test page breaks in excel ? i have my app running on different pc's with different printers (and different printer margins) and i want to be sure to have a maximum of information on every page.

other problem : i insert pictures on my excel pages, and i don't want the pictures to be cut in half and displayed on 2 pages. my rows don't always have the same height, so i can't rely on the number of rows already used.

any help is greatly appreciated. good day to you all,


Excel Page Setup

My problem is i want to set the FitToTall and FitToWide = 1 and i want want to set the left margin = 0 in the page setup

It runs OK Without any error but when i print it out it comes out in 2 sheets but if i do the above by hand it comes out in 1.

Here is the code

Dim XL As Excel.Application
Set XL = CreateObject("Excel.Application")
XL.Application.Visible = False
XL.DisplayAlerts = False
XL.Workbooks.Open TempPath
With XL.ActiveSheet.PageSetup
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
XL.ActiveSheet.PageSetup.LeftMargin = XL.Application.InchesToPoints(0)
Set XL = Nothing
i got the above code by recording a macro in excel

Any help appriciated

Thanx Shane

Page Breaks In Excel
Hi again,

I've been trying to get round a certain problem for three days and I'm almose there now

All I need is the code to add a page break into Excel .....

I've run a Macro in Excel and get the following code :

ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
When I try and run this I get several errors, I need something that will slot onto the bottom of this (in the same format please, I realise there are better ways to code than this but I don't have time to re-write).

XLApp.Worksheets("sheet1").[C4].Value = strrequesting
XLApp.Worksheets("sheet1").[C6].Value = strquantity
XLApp.Worksheets("sheet1").[E6].Value = strproduct
XLApp.Worksheets("sheet1").[H6].Value = strholding
XLApp.Worksheets("sheet1").[E10].Value = strref
XLApp.Worksheets("sheet1").[D16].Value = Format(strexpected, "yyyy/MM/dd")

Many thanks


Excel Page Layout
I'm struggling to set the page layout of my worksheets.

I have an undefined amount of worksheets, and in those sheets i will only have one table about 2 columns wide and 5 rows long, and I want to print out six or eight of thses tables on one page.

I have tried all of my code knowledge to automate this, and have even resorted to "record new macro" and then doing it manually, when i do that, the code does specify a lot of ranges, but not the one I want.

Is there any way I can set Excel to put 6 or 8 per page.

Just incase you don't know where this actual function is.

File --> Page Setup --> Options --> Page Layout (drop down box)
I have set my printarea to specify the table i want to print on each worksheet.

Sub SetPrintArea()

For x = 1 To Sheets.Count
Worksheets(x).PageSetup.PrintArea = "B1:C6"
Next x

End Sub
But I just want to know how to set this to print 8 sheets to a page

Open IE With Excel And Log Into Page

I am trying to open the Internet Explorer go to a specific HP and then to log in.

I managed to get to the HP with the following code:

Shell ":Program FilesInternet Exploreriexplore.exe https:\ ",vbNormalFocus

Unfortunately, I am stuggeling with entring the username and the pw automatically.

Can anyone help me?


How To Take Data From Web Page And Put Into Excel?
Exactly that. Need to go through pages and take info. Pages are mainly the same.

Page Breaks In Excel
How do I inset a page break into an excel document? Simple, I know, but I can't figure it out...

Print First And Last Page In Excel
I am trying to build a macro in VB to print out only the first and last page of Excel reports that I produce. Is there anything that returns the last page?

Web Query From An .asp Web Page Into Excel
I have used excel's web query function in the past to import data from web pages for comparisons. I usually click on the frame/information I want and excel will then paste this to the appropriate cells. I can then format the information for use.

This works fine on an HTML page but to try and do this on an .asp page results in an error that says:
[End tag 'head' does not match the start tag 'link'.] Does anyone have a solution/workaround for this?

Further to this, on most .asp 'frames', I need to select a link/option to get to the actual information that I want to extract. I have used get/post statements to do this in the past in other applications but am unsure how you read the source to define what should be sent to the server to move to the next page (I appreciate that this may be a bit out of scope for this section). Can anyone help with this or point me somewhere for further help?

I am using XP home and Office 2002 SP2.

Thanks in advance for any help.

Vb Want Print My Excel Page.
Hello people,

I'm trying to find the vb code to print a page out of a excel file.

VB Code:
Spreadsheet3.XMLURL = App.Path & " est.xls"Spreadsheet3.ActiveWorkbook.Sheets("Blad3").SelectSpreadsheet3.ActiveWindow.SelectedSheets.PrintOut Copies:=1

I get everytime a error on PrintOut with the message Method or data member not found.
What is wrong and is there somebody who can help me with the correct line.

Excel End Of Page [URGENT]
how do u figure out the excel's end of page?

there are a couple of headers i need in the excel spreadsheet. these headers are dynamic table headers so use rows as header options dont work for me. i need these headers at the top of every page to be printed.

Reading From Excel Into A Web Page
I 've been asked to create a webpage that reads certain cells from a spreadsheet. Is this at all possible?

Page Numbers In Excel
I'm using Excel to do some simple reporting from Visual Basic and SQL Server. However I need to put the page number and number of pages in the header or footer. I have tried simply outputting the text "&[Page] of &[Pages]" to the Header property but it comes out as text. Any ideas?

Sample Code:
oSheet.PageSetup.RightHeader = " &[Page] of &[Pages]"

Set Excel Page Header
I have a NAME in a different sheet (say sheet #3).

I would like to referto/use that name in setting the LeftHeader of the main sheet (sheet #1) during an initialization routine.


Open PDF To A Page Using VB/Excel
There's nothing to just opening a file inserted into a Excel sheet, but I need to open it to a page or section. I've thought of two ways of doing it, but am having no luck making either happen:

1. Use classes and objects from Adobe Acrobat library. I just don't know
enough about AcroApp, AcroAVDoc, AcroAXDoc, AcroPDDoc. ... to make
that work.

2. Copy the file to disk (C:TEMP) and use a DOS command to work with the
file. With this one, I can't find a way to paste an entire file from
clipboard to disk.

I'm looking at two dead-ends here. Any help is appreciated.

QueryTables.Add In Excel With Web Page
Hello all. Any help on this issue will be much appreciated. I am racking my brain on this one. I am trying to parse data from a web site. The web site requires a log in and password. Then a number has to be entered to search on. From the the link for the product has to be selected, then the page has to go to a summary page. I am at the point where within my code I can get it to point to the correct page. Now, I am trying to do a QueryTables.Add to pull the data from the current page into an Excel Spreadsheet. My problem is when specifying the connection, I cannot put in the link to the page becasue it is a general page in asp, looking something like: I cannot use this link because it will default back to the login page. Is there a way to do: QueryTables.Add(Connection:="URL;" & <Current Page>, Where <Current Page> is the active page rather than specifying a URL? I have not been able to figure out how to do it if it can even be done. See sample code below:

Code:Public Sub Login(ID As String, Pass As String)
    Dim Complaint As String
    Dim URL As String
    Set IQDS = CreateObject("InternetExplorer.Application")
    'create new instance of IQDS

    URL = ""
    'go to web page listed inside quotes
    IQDS.Visible = True

    With IQDS
        .navigate URL
        Do While .readystate <> 4: DoEvents: Loop
        Do While .busy: DoEvents: Loop
        .Document.All("T_LO_usr_id").Value = Trim$(ID)
        .Document.All("T_LO_password").Value = Trim$(Pass)
        SendKeys "~"
    End With
    IQDS.Visible = False
    Complaint = InputBox("Enter complaint #", "Complaint #")
    With IQDS
        .navigate URL
        Do While .readystate <> 4: DoEvents: Loop
        Do While .busy: DoEvents: Loop
        .Document.All("T_N_CS_complaint_no").Value = Trim$(Complaint)
        SendKeys "~"
    End With
    URL = "" & Trim$(Complaint)
    IQDS.Visible = True
    With IQDS
        .navigate URL
        Do While .readystate <> 4: DoEvents: Loop
        Do While .busy: DoEvents: Loop
        .Document.F_Main.H_TNav.Value = "CmplSum"
        .Document.F_Main.H_action.Value = "Redirect"
        .Document.F_Main.H_action_parm.Value = ""
        Do While .readystate <> 4: DoEvents: Loop
        Do While .busy: DoEvents: Loop
With ActiveSheet.QueryTables.Add(Connection:="URL;" & <Current Page>, _ <----------Area where help is needed
        .WebFormatting = xlNone
        .WebSelectionType = xlAllTables
        End With

        With ActiveSheet
        .Columns("A:Z").WrapText = True
        End With
    End With
End Sub

Edited by - smcondra on 10/11/2005 12:47:43 PM

Updating A Web Page From Excel
I don't work with Excel much and I don't really do web pages that involve much coding. I'm more of a straight HTML guy.
I don't even know if I'm putting this in the right forum or if this is the place to ask this but here goes.

I have a guy at work that wants me to build him a web page that gets updated from an Excel spreadsheet. Whenever he makes a change to his spreadsheet, he wants it to update the web page automatically.

I told him it would be easier if he used a database but he wants to use Excel since he's only working with 40-50 records. He wants to keep the spreadsheet on his system for security and only display the data on the web page.

Any ideas, or am I asking in the wrong arena?

Thanks for any help.

Mike Godwin

KB8TRM - 40°08'2.202"N 82°54'20.491"W
Visit my website or the terrorists win!

Launch Excel From Web Page
I need a link from a web page that would (i) open Excel and (ii) open an existing Workbook file. I have code for opening a new instance of Excel, but I need to open a file, or Workbook, that already exists. Can you help? Thanks.

P.S. If I'm in the wrong forum, please let me know.

Filling An Excel Page (Again)
Ok, I've changed my code from my earlier post to use the .clip property:

With MSFViewer
.Row = 0
.Col = 0
.RowSel = (.Rows - 1)
.ColSel = (.Cols - 1)
mExcel.Application.ActiveWorkbook.Worksheets.Application.ActiveCell(1, 1) = .Clip
End With

but this displays all the info in one cell
Any suggestions on how to expand this to one entry - one cell?
Thanks again


Filling An Excel Page
I've got a program that exports cell by cell from a MSFlexGrid to an excel worksheet, using the code:

With MSFViewer
for mRow = 0 to .Rows - 1
for mcol = 0 to .Cols - 1
mXcol = Chr(65 + mcol)
mExcel.Application.ActiveWorkbook.Worksheets.Application.ActiveCell(mRow + 1, mXcol) = .TextMatrix(mRow, mcol)
End With

This works fine but is very slow.

Is there a way of cutting and pasting the whole grid directly into excel?


How To Count The Excel Page Number??
Dear All,

I have a program that Export the Data to the Excel to generate a time table to all the students and lecturers with have assigned to different course and class. In order to print the time table i have to calculate the page number of the Worksheet!!

The How to count the Page Number?????

Populating Web Page With Excel Data
I have found some good information on this site for doing a lot of what I need to do, but I am having a problem with one thing. One of the input fields on the web page is of type radio. I am having a problem figuring our how to index to the correct radio selection and "check" the option that I want.

The input field on the HTML form looks something like this:

<INPUT type=radio CHECKED value=1 name=Opt1>First Option<BR>
<INPUT type=radio value=2 name=Opt1>Second Option<BR>
<INPUT type=radio value=3 name=Opt1>Third Option<BR>
<INPUT type=radio value=4 name=Opt1>Fourth Option<P>
The Code I'm working with is:

Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

'Navigate to the web page
IE.Navigate ""

'Wait for the page to finish downloading
Do While IE.busy

For Each Element in IE.Document.All("Opt1")
If Element.Value = 3 Then Element.Checked = True
This works, but if I assume there is a why that I can do something like this instead:

IE.Document.All("Opt1").???.Checked = True
But I'm not sure what needs to be in the space where ??? is to index to the Third Option of the radio selection.

Anybody know how I would go about doing this?

Thanks in Advance!

Pressing A Link In IE Page From Excel VBA
I have a macro that I am creating that allows me to put the cursor on a row in a excel spreadsheet and then opens a copy of IE and goes to a certain site and fills in a form with data that comes from the row in Excel. That works great. I do a submit of the form with

ie.Document.Forms(1).Submit.Click and then the ASP page comes back with a link such as :

<table width="100%" border="0" cellspacing="0" cellpadding="5"><tr width="99%" align="center"><td class="text"><table width="99%" border="0" align="center" cellpadding="0" cellspacing="0"><tr class="level3B"><td class="namecity">Frederick C. Semrau&nbsp;-&nbsp;Boonton, NJ</td><td>&nbsp;</td><td class="profilesite">&nbsp; <a href=/lawyer/lawyer_dir/search/jsp/profile_viewLawyer.jsp?lawyerUid=5534793 target=_top>View Listing</a></tr></table></td></tr></table>

What I want to automate is clicking on the View Listing hyperlink. How do I do this within VBA running in Excel. Here is the whole macro:

Sub Macro1()

Dim ie As Object
ie.Navigate ""
ie.Visible = True

While ie.busy

ie.Document.Forms(1).Name.Value = ActiveCell.Offset(0, 14).Value
ie.Document.Forms(1).fname.Value = ActiveCell.Offset(0, 12).Value
ie.Document.Forms(1).city.Value = ActiveCell.Offset(0, 5).Value
ie.Document.Forms(1).State.Value = ActiveCell.Offset(0, 6).Value


End Sub

Parse A Web Page Into An Excel Sheet
First, we'd like to say hello.

Ok. My lab partner and I are having difficulty with a VB program. We are supposed to parse a webpage from HTML code into an excel spreadsheet, using a file inputed from a user. We have our program outlined below

Public Sub vbaprogram()
Dim userinput As String
Dim file As String
Function Parse() As String
Function Build() As String

userinput = InputBox("Do you want to parse or build? Please put P or B.")

If userinput = P Then
'start parsing
Call Parse

If userinput = B Then
'start building
Call Build

Else: InputBox ("Please enter either P or B.")
End If

End Function

Function Parse()
file = InputBox("Please enter file name.")
Open "file" For Input As 1

End Function

Function Build()
file = InputBox("Please enter file name.")
Open "file" For Input As 2
End Function

Ok, now, we arent quite sure how to approach this task. Can anyone help us determine how the function should be laid out? Thank you so much if anyone replies.

Chris and Sena

Excel Page Setup Problems Using Vb
I create financial models where the page format changes from legal to letter and vice-versa. I've written code in vb for Excel so that users wouldn't have to change the layout themselves.

5 of the 6 users have no problems printing in either page format. One does!!! It is as if Excel does not recognize his page formats.

I asked him to record a macro where he would change from letter to legal paper sizes and vice-versa. His code did not include :

With ActiveSheet.PageSetup
.PaperSize = xlPaperLetter


.PaperSize = xlPaperLegal

Can anyone help with this???

Page Count In Word And Excel?
How do I find out how many pages are contained in a word and excel file using automation???

Thank You

Controling The Execution Of An Excel Page Using DDE
Anybody knows if, using VB6, can I use the DDE functions to open an Excel page, recalculate it completely and control the end of the calculation?

Does Excel Have An API Documentation Page Like Java.
Does any one know?

I can find alot of code fragments but no API-like documentation page.


Excel VBA Slow Web Page Opening
Need some serious help.

I have a simple command that I open a web page from.
I have Excel 2002, it Works but takes a really long time.
Inside my office the scripts works very quickly, any ideas?


Executing Excel Macro From A Web Page
I have some VB behind a button (below) that starts a macro with parameters to open a workbook report.

What I need to be able to do is run this macro from a web page.

Can anyone help?




Private Sub Excel_version_Click()
If Run("SAPBEX.xla! SAPBEXreadWorkbook", "3P5SUTCVPVAQOUU094TZ5KZRG") = 0 Then
End If
End Sub


Changing Excel Page Size Through A VB App
I'm using Visual Basic to automate changing the page size field of an excel file.
We periodically need to change the page size of many excel files from A4 to letter etc...
So far its working ok on windows, but the excel files that I need to change needs to be used on Mac as well. The problem is, in Mac Excel 98 there is no page size field because this information is stored in 'Options'. So the page size value remains the same on MAC.
I guess it has to do with postscript printer settings saved in the excel file itself?
But how do you change these settings for Mac?
Is there any way to change the page setup value for Mac through my code on VB?

Example code:

Private Sub cmdProcess_Click()
Dim ExcelApp As New Excel.Application
Dim ExcelWB As Excel.Workbook
Dim ExcelWS As Excel.Worksheet
Dim savePathStr As String ' save path to overwrite

savePathStr = txtFile.Text

Set ExcelWB = ExcelApp.Workbooks.Open(savePathStr)
Set ExcelWS = ExcelWB.Worksheets(1)
ExcelWS.PageSetup.PaperSize = xlPaperA4

ExcelWB.SaveAs savePathStr, xlNormal

End Sub

Any suggestions appreciated...

Page Setup=landscape In Excel
hi, i want to make an excel file from visual basic wich is landscape

my code is this

oSheet.PageSetup.Orientation = Excel.Constants.xlLandscape

and it has the error xllandscape is not a member of excel.constants

Opening Web Page In Excel Worksheet

I am trying to open a webpage in a worksheet (not a form). I try this code for a macro connected to a button on the worksheet:

Private Sub OpenWebPage()

Sheets("sheetx").WebBrowser1.Navigate "http://www."

End Sub

I get this error: "Run-time error 438. Obejct does not support this property of method"

Any suggestions on what is incorrect? Also, how do I set the dimensions of the web browser window and specify where in the worksheet it should be placed? Thanks.


Detecting Page Breaks In Excel
The saga continues...

Now I'm trying to write a program to automate filling out an Excel spreadsheet...the problem is that the sheet is multiple pages and the first 9 rows contain header information for when the sheet is printed. Skipping down 9 rows and continuing is no problem, but detecting where the page break is...well, is.

So, how can I detect where a page break, either hard or soft, is, and whether or not the row I'm on is the row immediately preceding the break?

Me and my boss both say thanks for any help in advance.

Save As An HTML Page With Excel

I didn't arrive to use the ExecWB command in order to save an HTML file (with images ...) on the hard drive.

I'm a beginner in VBE.

For the moment, I arrive to save to a .txt file.

In fact, i would like to do as Internet Explorer did. 'File', 'Save As' with two parameters : URL and path_on_hard drive.

I think i have to use the following command :
But i have never find the correct syntax.

Thanks by advance !

Get Number Of Page Breaks In Excel

I'm trying to findout the number of Partial Horizontal Page Breaks.

I've found the following in the Help, but it doesn't seem to work: -

For Each pb in Worksheets(1).HPageBreaks
If pb.Extent = xlPageBreakFull Then
cFull = cFull + 1
cPartial = cPartial + 1
End If
MsgBox cFull & " full-screen page breaks, " & cPartial & _
" print-area page breaks"

The first question I have is is 'pb' declared as HPageBreak?

I've tried the code, but it doesn't seem to loop

Can anyone point me in the right direction?


Vb6 Combo Box Problem On Excel Page

I'm using Excel VBA. I have a combo box in a template sheet with the fillrange set to a range in a separate data sheet in another workbook, workbook1. The combo box reads fine when I open both workbooks separately and manually but when I use a command button from Workbook1 to open the template the combo box no longer shows my options.

I'm thinking the combo box needs to be refreshed after I open the template. Is there any way to do this, since I tried activesheet.cboChoose.refresh and got an error that "this object doesn't support this property or method". I even tried activesheet.cboChoose.requery and got the same error.

Any other ideas would be greatly appreciated.

Thanks in advance.

How To Print Custom Page # In Excel ?
I need to print in a cell (not in the footer) the custom page # of the printed sheet. For example, if a sheet occupies two printed pages then the first page should show in cell A1 "Page A" and the second page should show in cell A1 "Page B".

How can it be done in VB?

Thank you


Flickering Problem In Excel Page!
Hi again,

In the continuation of my last post and to try to find a solution for it, i open a new topic just for the flickering problem.

The question is the following: i have a worksheet that i use for my documents, just like a database propose. I insert rows when i want to update the page with new values! I attach my working file just to see what i'm talking about. The problem is when i insert a new row. i use in the page forms like rectangles. when i insert the row the forms flick, just disappear for a second!

If anyone have some ideas how to resolve this i will be thankful!

Populating Excel Sheet From A Web Page
Hi all,
  following are my querries :
 1) how do i invoke MSExcel from my web page?
 ( i want to invoke excel to make it draw a graph for me)

2) also to make excel draw a graph(chart) i will have to populate the excel sheet with values returned by my sql.
how do i fill/populate an excel sheet?

3) assumung the above two work fine i.e excel draws a graph for there anyway for me to save it as a .jpg or a .gif thru my web page that when i make the brower call my page he gets a .jpg or .gif graph/chart?

  PS: i dont want code for the above querries but only hints/pointers that will help me understand how to go about it and write the code myself.


How To Access Sql Server From Excel Page
hi all,
i am trying to connect to sql server from excel page is there anyway to do this? and any way to list databases and tables
waht i am trying to do is there will be a button on my excel page, when i click it will connect to sql server and list the databases in a combobox. when i click one of the databases from combobox tables in that database will be shown in a combo box and when i click one of the tables content of table will be shown excel page
is this possible? (my english isnt ok i hope you could understand)

Copyright 2005-08, All rights reserved