当前位置:网站首页>VBA判断文件是否存在及问文件备份思路
VBA判断文件是否存在及问文件备份思路
2022-06-10 15:57:00 【OOQ】
对文件进行保存的时候,可能会遇到已经存在相同文件名的文件。此时,再次进行保存的时候会发生异常,那么想要保存当前这个文件的时候,我们就需要判断文件是否存在。如果文件存在我们就 Kill(fileName) ,然后再进行保存操作。
If Dir(FileName) <> "" Then
MsgBox ("文件存在")
Kill (FileName)
Else
MsgBox ("文件不存在")
End If
以上的解决思路,面临一个问题,就是一般无法确保文件Kill掉的文件是否有用。此时,可以通过更改文件名(原文件名+Time)的方式,进行一个备份。
边栏推荐
- Come with me to understand gaussdb (for opengauss) [Gauss is not a mathematician this time]
- Devops-1- introduction
- AttributeError: module ‘gym. envs. Box2d 'has no attribute' lunarlander 'solution
- 提高效率的 5 个 GoLand 快捷键,你都知道吗?
- Digital image processing: graying
- Why do I need a thread pool? What is pooling technology?
- Rethinking atlas revolution for semantic image segmentation (deeplobv3) personal summary
- MySQL如何修改字段类型和字段长度
- 亦舒作品经典语句
- Fosun Group hekaiduo: grow together with Alibaba cloud and help business innovation
猜你喜欢

Can deleted wechat friends be recovered? How to retrieve wechat friends after they are accidentally deleted

postman参数化

Palm detection and finger counting based on OpenCV

毕业季:致走向辽远未知的你

Take you to play completablefuture asynchronous programming

This paper introduces three feature selection methods in machine learning

From web2 to Web3, ideology also needs to change

Introduction to postmangrpc function

Actual combat of software testing e-commerce project (actual combat video station B has been released)

打造隐私计算领先方案 冲量在线数据互联平台获得鲲鹏Validated认证
随机推荐
Chinese translation of Rilke's autumn with heartless sword
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
Come with me to understand gaussdb (for opengauss) [Gauss is not a mathematician this time]
数字图像处理:灰度化
Then, we will cooperate with impulse online and Feiteng to complete partner certification and jointly create a private computing ecosystem for Xinchuang
迪赛智慧数——文字(文本墙):80后儿童时期风靡的25种玩具
Why do I need a thread pool? What is pooling technology?
AI video cloud: a good wife in the era of we media
Desai wisdom number - words (text wall): 25 kinds of popular toys for the post-80s children
Duyuan outdoor sprint to Shenzhen Stock Exchange: the annual revenue is 350million, and the color of Lin Xizhen family is obvious
Jerry's interface for obtaining ble broadcast package and profile data [chapter]
oss存储引出的相关内容
Digital image processing: graying
Institute of automation, Chinese Academy of Sciences: a review of the latest visual language pre training
亦舒作品经典语句
Quickly understand the commonly used symmetric encryption algorithm, and no longer have to worry about the interviewer's thorough inquiry
Hoo Hufu Research Institute | noteworthy track in March 2022
Detailed explanation of RGB color space, hue, saturation, brightness and HSV color space
MM主要的表和主要字段_SAP刘梦_
Devops-3 cloud computing and cloud era operation and maintenance