当前位置:网站首页>VBA判断文件是否存在及问文件备份思路
VBA判断文件是否存在及问文件备份思路
2022-06-10 15:57:00 【OOQ】
对文件进行保存的时候,可能会遇到已经存在相同文件名的文件。此时,再次进行保存的时候会发生异常,那么想要保存当前这个文件的时候,我们就需要判断文件是否存在。如果文件存在我们就 Kill(fileName) ,然后再进行保存操作。
If Dir(FileName) <> "" Then
MsgBox ("文件存在")
Kill (FileName)
Else
MsgBox ("文件不存在")
End If
以上的解决思路,面临一个问题,就是一般无法确保文件Kill掉的文件是否有用。此时,可以通过更改文件名(原文件名+Time)的方式,进行一个备份。
边栏推荐
- 圆周率 π 小数点第 100 万亿数字是多少?Google 用 Debian 服务器给出了答案
- Postman common assertions
- Have you ever written a line of efficient code that equals 20 lines of others?
- 51 timer initial value calculation
- Fiddler设置断点
- Then, we will cooperate with impulse online and Feiteng to complete partner certification and jointly create a private computing ecosystem for Xinchuang
- Palm detection and finger counting based on OpenCV
- AI video cloud: a good wife in the era of we media
- postman切换主题
- 嵌入式开发:使用MCU进行无线更新面临的5大挑战
猜你喜欢

AI video cloud: a good wife in the era of we media

迪赛智慧数——文字(文本墙):80后儿童时期风靡的25种玩具
![[untitled]](/img/90/537a57dfbdb4e00e424c8999983ae8.jpg)
[untitled]

Shit, jialichuang's price is reduced again

Then, we will cooperate with impulse online and Feiteng to complete partner certification and jointly create a private computing ecosystem for Xinchuang
sql注入报错之注入原理实例解析

Software College of Shandong University Project Training - Innovation Training - network security range experimental platform (XVII)

Why do I need a thread pool? What is pooling technology?

Postman common assertions

Hoo Hufu Research Institute | noteworthy track in March 2022
随机推荐
Can deleted wechat friends be recovered? How to retrieve wechat friends after they are accidentally deleted
纽约金融监管机构发布正式的稳定币指南
Nanomq newsletter 2022-05 | release of V0.8.0, new webhook extension interface and connection authentication API
全链路追踪 & 性能监控工具 SkyWalking 实战
PV operation daily question - black and white chess question
Exploration of kangaroo cloud data stack on spark SQL optimization based on CBO
MM主要的表和主要字段_SAP刘梦_
Analysis report on marketing status and demand potential of China's acetate starch industry 2022-2028
Weilai quarterly report diagram: the revenue was 9.9 billion yuan, a year-on-year increase of 24%, and the operating loss was nearly 2.2 billion yuan
数字图像处理:灰度化
PV operation daily question - black and white chess question (variant)
Jerry's ble abnormal power consumption [chapter]
Financial risk control practice - anomaly detection (I)
STOP在屏幕程序的应用_SAP刘梦_
Diagram of the quarterly report of station B: the revenue is RMB 5.1 billion, with a year-on-year increase of 30% and nearly 300million monthly active users
Web2 到 Web3,意识形态也需要发生改变
New York financial regulators issue official guidelines for stable currency
PV operation daily question - exam questions
Li Ling: in six years, how did I go from open source Xiaobai to Apache top project PMC
Zhangxiaobai teaches you how to use Ogg to synchronize Oracle 19C data with MySQL 5.7 (3)