【VBA】打开关闭工作簿等

摘要:
打开关闭工作簿等。1Sub打开工作簿()2DimsFilePathAsString3sFilePath=“D:A.xls”4imoWBAsWorkbook5SetoWB=Excel。工作手册。打开(sFilePath,ReadOnly:=False,writerepassword:=“123”)6delay(5)7IfNotoWB。只读The89oWB.CloseSa

打开关闭工作簿等

 1 Sub 打开工作簿()
 2      Dim sFilePath As String
 3      sFilePath = "D:A.xls"
 4      Dim oWB As Workbook
 5      Set oWB = Excel.Workbooks.Open(sFilePath, ReadOnly:=False, writerespassword:="123")
 6      delay (5)
 7      If Not oWB.ReadOnly Then
 8      
 9          oWB.Close SaveChanges:=True
10      Else
11          MsgBox "文件只读,无法修改!"
12          oWB.Close SaveChanges:=False
13      End If
14      Set oWB = Nothing
15 End Sub

免责声明:文章转载自《【VBA】打开关闭工作簿等》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Eclipse中创建Maven多模块工程C#操作Xml:通过XmlDocument读写Xml文档下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

vb listview 的常用操作

常用操作:获取当前行数和列数: MsgBox "行数:" & ListView1.ListItems.Count & "列数:" &ListView1.ColumnHeaders.CountPrivate Sub ListView1_MouseMove(Button As Integer, Shift As Integer, x A...

deepfake 资源总结

  1. https://zhuanlan.zhihu.com/p/34042498   深度解密换脸应用Deepfake 2. 在 1 里面提到的PixelShuffle,具体见参考3: https://mathematica.stackexchange.com/questions/181587/how-to-define-a-pixelshuffle...

提取PPT文件中的Vba ProjectStg Compressed Atom。Extract PPT VBA Compress Stream

http://msdn.microsoft.com/en-us/library/cc313106(v=office.12).aspx 微软文档 PartI ****************************************************************************** 简单讲一下如何找到VbaProjectStg...

VBA常用快捷键

摘自Excel 2007 Visual Basic用户界面帮助. 不过有些和系统快捷键冲突,就不起作用了.如Ctrl+Space,可以使用快捷键在代码窗口中访问下列命令。描述 快捷键查看代码窗口 F7查看“对象浏览器” F2查找 CTRL+F替换 CTRL+H查找下一个 F3查找前一个 SHIFT+F3下一个过程 CTRL+DOWN ARROW前一个过程...

pub/sub的实际应用总结

pub/sub即观察者模式,有多重表现形式 1. Publisher/Subscriber2. Observer/Observable3. Listener(例如EventListener)4. EventBus5. EventEmitter EventBus这种不只是观察者模式,还包含了中介者模式,bus就是一个中介者,负责在消费者和生产者之间转发消息而...

Database Patch Conflict Resolution (Doc ID 1321267.1)

Copyright (c) 2020, Oracle. All rights reserved. Oracle Confidential. Database Patch Conflict Resolution (Doc ID 1321267.1) In this Document Goal Ask Questions, Get Help, And Shar...