Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ms access 2k automation problem with selection
I copied some code from an Excel macro I created into an MS Access 2k
module. Much of it's fine except anything that Set objActiveWkb = objXL.Application.ActiveWorkbook With objActiveWkb Range("A1:G1").Select With Selection .HorizontalAlignment = xlCenter <<<<<< ERROR HERE (and all next lines in this "with") .VerticalAlignment = xlBottom .WrapText = False .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With End With I have my reference to Excel 11 set otherwise nothign would work. However, the "Selection" object appears to have no properties or methods. Do I need to do this instead (which does compile): Set objActiveWkb = objXL.Application.ActiveWorkbook With objActiveWkb with Range("A1:G1") <<<<<<<< CHANGED LINE (and removed line "with selection") .HorizontalAlignment = xlCenter .VerticalAlignment = xlBottom .WrapText = False .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With End With Thanks, Keith |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automation to Excel from Access | Excel Discussion (Misc queries) | |||
.selection.find not working via automation | Excel Programming | |||
Access to Excel Automation ADODB Problem | Excel Programming | |||
OLE automation - use of .selection | Excel Programming | |||
Automation Code Problem from Access to Excel | Excel Programming |