office交流网--QQ交流群号

Access培训群:792054000         Excel免费交流群群:686050929          Outlook交流群:221378704    

Word交流群:218156588             PPT交流群:324131555

WPS相对于Office不支持的一些功能 方法 属性 事件(逐步更新)

2021-01-27 08:00:00
zstmtony
原创
6056

在这几年使用WPS的VBA开发中,发现WPS的VBA接口中有一些功能并未完全实现(tmtony, 先想到一些就列出来

1.activesheet.chartobjects(1).chart.export activeworkbook.Path & "\test3.gif","gif"  gif在office支持,但wps不支持。 PNG JPG均支持

但注意Office,需要安装 图形筛选器,否则会提示 图形筛选器无法转换此文件

2.Wps用代码生成图表及将图表转换成图片要比Office快很多。
3.Wps中对内容搜索Find也要比Office快很多,很奇怪

4.以下代码在wps个人版支持,在Wps政府专业版本中不支持:ChartTitle.Format.TextFrame2.TextRange.Characters(1, 6).ParagraphFormat

   Dim chrt As Object
 Set chrt = ActiveSheet.ChartObjects(1)
 With chrt.Chart.ChartTitle.Format.TextFrame2.TextRange.Characters(1, 6).ParagraphFormat
        .TextDirection = 1 ' msoTextDirectionLeftToRight
        .Alignment = 2 ' msoAlignCenter
    End With
    MsgBox "10"
    With chrt.Chart.ChartTitle.Format.TextFrame2.TextRange.Characters(1, 6).Font
        .BaselineOffset = 0
        .Bold = -1
        MsgBox "11"
        .NameComplexScript = "+mn-cs"
        .NameFarEast = "+mn-ea"
        .Fill.Visible = -1 ' msoTrue
        .Fill.ForeColor.RGB = RGB(89, 89, 89)
        .Fill.Transparency = 0
        .Fill.Solid
        MsgBox "12"
        .Size = 14
        .Italic = msoFalse
        .Kerning = 12
        .Name = "+mn-lt"
        .UnderlineStyle = 0 ' msoNoUnderline
        MsgBox "13"
        .Spacing = 0
        .Strike = 0 ' msoNoStrike
    End With



chart.export filename, "GIF"

oChart.Export(Server.MapPath("~/App_Data/Graphs/Graph2.gif"), "GIF")
Solution to this problem is in MSI installer to register aspnet account

to resolve your Problem go to c:\windows\system32\msi.dll
view properties
from security tab add aspnet account and give full permission to all
apply your setting

reboot your computer this should solve your problem.

if there is any problem go to event viewer of system and see what hkcu does not have permission. simply give permission to clsid
you may have to run dcomcfg.

分享