当前位置:网站首页>VBA判断文件是否存在及问文件备份思路
VBA判断文件是否存在及问文件备份思路
2022-06-10 15:57:00 【OOQ】
对文件进行保存的时候,可能会遇到已经存在相同文件名的文件。此时,再次进行保存的时候会发生异常,那么想要保存当前这个文件的时候,我们就需要判断文件是否存在。如果文件存在我们就 Kill(fileName) ,然后再进行保存操作。
If Dir(FileName) <> "" Then
MsgBox ("文件存在")
Kill (FileName)
Else
MsgBox ("文件不存在")
End If
以上的解决思路,面临一个问题,就是一般无法确保文件Kill掉的文件是否有用。此时,可以通过更改文件名(原文件名+Time)的方式,进行一个备份。
边栏推荐
- Jerry's long press reset and high level reset [chapter]
- Devops-1- introduction
- Four Byron poems translated from heartless sword
- webdypro layout控件不能用_SAP刘梦
- Take you to play completablefuture asynchronous programming
- Comply with medical reform and actively layout -- insight into the development of high-value medical consumables under the background of centralized purchase 2022
- Build a leading privacy computing scheme impulse online data interconnection platform and obtain Kunpeng validated certification
- Desai wisdom number - words (text wall): 25 kinds of popular toys for the post-80s children
- PV operation daily question - Restaurant Service
- 直播预告 | 社交新纪元,共探元宇宙社交新体验
猜你喜欢

What are the pitfalls of redis's current network: using a cache and paying for disk failures?

CAN总线协议基础

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

Shit, jialichuang's price is reduced again

Take you to play completablefuture asynchronous programming
![Jerry's interface for obtaining ble broadcast package and profile data [chapter]](/img/ae/70cde8684fa536c37387ce819a36eb.png)
Jerry's interface for obtaining ble broadcast package and profile data [chapter]

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

postman常用断言

Carry forward the past and forge ahead into the future, multiple residuals | densenet (II)

直播预告 | 社交新纪元,共探元宇宙社交新体验
随机推荐
webdypro layout控件不能用_SAP刘梦
Devops software architecture evolution
Effect comparison and code implementation of three time series hybrid modeling methods
Quickly understand the commonly used symmetric encryption algorithm, and no longer have to worry about the interviewer's thorough inquiry
Postman parameterization
Basic settings of pycharm [detailed explanation with pictures and words]
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
AttributeError: module ‘gym. envs. Box2d 'has no attribute' lunarlander 'solution
Jerry's ble timer clock source cannot choose OSC crystal oscillator [chapter]
【无标题】
迪赛智慧数——文字(文本墙):80后儿童时期风靡的25种玩具
Webdypro layout control cannot be used_ SAP LIUMENG
What are the pitfalls of redis's current network: using a cache and paying for disk failures?
Palm detection and finger counting based on OpenCV
oss存储引出的相关内容
Rethinking atlas revolution for semantic image segmentation (deeplobv3) personal summary
postman参数化
Jerry's ble OTA upgrade requires shutting down unnecessary peripherals [chapter]
Two methods of modifying PIP download source
Hoo Hufu Research Institute | noteworthy track in March 2022