' Creates the Excel App and workbook, and adds the sheet
Dim xlApp As Excel.Application
Dim xlWorkbook As Excel.workbook
Dim xlWorksheet As Excel.Worksheet
Set xlApp = CreateObject("Excel.Application")
Set xlWorkbook = xlApp.Workbooks.Add
Set xlWorksheet = xlWorkbook.Sheets.Add
' The row index...
I have everything working now, except for the Page Breaks.
I set the printArea range to be the entire sheet, but that doesn't seem to work. It always defaults to the default page break.
Any ideas on this?
--whit
Ah, okay, things are becoming clearer to me now.
Turns out i didn't have the Excel Object Library referenced, so i guess that would explain half of the errors i was getting!
I want to thank you guys for enduring these problems and helping me out!
I appreciate it.
--whit
Yes, i tried that, and it says:
"Object doesn't support this method or property"
as an error message. Does this have something to do with me binding my excelsheet reference as an object and not an excel sheet?
I thank you for your help. I am getting an "Object Required" error on the first line of the code you gave me (the put it all together bit) in your last post. This is what i have in my code:
Dim ExcelSheet As Object
Set ExcelSheet = CreateObject("Excel.Sheet")
ActiveSheet.PageSetup.Orientation...
well, i have tried many things. First, i used the macro recorder, and tried to past in the code there into my VBA code, and that didn't work:
With ActiveSheet.PageSetup
.Orientation = xlLandscape
end with
ActiveWindow.View = xlPageBreakPreview
ActiveSheet.VPageBreaks(1).DragOff...
How can i set the pageOrientation of my sheet to be landscape, instead of portraid, and how do i also move the page break further to the right so that my entire sheet can be printed width-wise on a landscape configuration?
to start my excel object i did:
dim excelSheet as object
set excelsheet...
well, i think my description of what i want to do is confusing.
within a cell i have a lot of text (and word wrap is turned on). the column width is set at a specific size, so the text will wrap and the height of the column adjusts to whatever the amount of text is. the problem is that the next...
Is there a way to set excel's cell padding size?
right now the access to my sheet is:
Dim ExcelSheet As Object
Set ExcelSheet = CreateObject("Excel.Sheet")
and i'm setting stuff through:
excelsheet.application.cells(...).property
or through a range of cells.
Okay, i have another question...
i did this, and the application.visible = true, and it opens up Excel. The only thing is, i'm doing this in a sub, and once i put the application to visible= true, it goes to "end sub" and excel is exited. How can i make this stay open so the user can edit the...
How do i open a pre-existing excel file (*.xls) using VBA in microsoft Access?
When i try to use
dim workbook as Excel.Workbook
i am getting an error, so i therefore cannot use any of the code i have found on the web. Any suggestions?
Any help is much appreciated! Thanks in advance
--whit
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.