本文介绍了从访问程序中操纵excel范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用"with selection"和"end with"操作来自访问程序的excel中的范围选择时,程序会运行一次,然后当我再次运行时挂起;我需要结束声明不同?


 


    XLAPP.Application.Range(Selection,Selection.End(xlToRight))。选择

   使用XLAPP.Selection

        .Horizo​​ntalAlignment = xlCenter

        .VerticalAlignment = xlBottom

        .Orientation = 90

        .AddIndent = False

        .IndentLevel = 0

        .ShrinkToFit = False

        .ReadingOrder = xlContext

        .MergeCells = False

   结束

解决方案

when manipulating a range selection in excel from an access program using the 'with selection' and 'end with' the program works once then hangsup when I run a second time; do I need to end the with statement differently?

    XLAPP.Application.Range(Selection, Selection.End(xlToRight)).Select
    With XLAPP.Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlBottom
        .Orientation = 90
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With

解决方案


这篇关于从访问程序中操纵excel范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 22:29