SamanthaNZ
New Member
- Joined
- Aug 16, 2021
- Messages
- 3
- Office Version
- 365
- Platform
- Windows
Hi there experts!
I have a preexisting VBA code to create and submit data files into a Snowflake Data Warehouse. Now, they'd like me to change the data file names to have a version suffix, to differentiate files in case we need to resubmit them during the month. For example "..._01", "..._02", "..._03" etc. It is very unlikely we would submit more than four times per month.
I have "Dim FileName As String". This currently includes the file location and file name which includes a fixed title component, the month and year. I would now like to define FileName to also include the appropriate suffix. If this can be achieved, I won't have to amend the entirety of the VBA code where FileName is repeatedly referred to. I have tried the code below, but when the macro progresses it won't allow me to save the new file as FileName, so I must not have defined it correctly.
Is it possible to change the definition of FileName depending on what files already exist?
Thank you so much!!
Samantha
I have a preexisting VBA code to create and submit data files into a Snowflake Data Warehouse. Now, they'd like me to change the data file names to have a version suffix, to differentiate files in case we need to resubmit them during the month. For example "..._01", "..._02", "..._03" etc. It is very unlikely we would submit more than four times per month.
I have "Dim FileName As String". This currently includes the file location and file name which includes a fixed title component, the month and year. I would now like to define FileName to also include the appropriate suffix. If this can be achieved, I won't have to amend the entirety of the VBA code where FileName is repeatedly referred to. I have tried the code below, but when the macro progresses it won't allow me to save the new file as FileName, so I must not have defined it correctly.
Is it possible to change the definition of FileName depending on what files already exist?
Thank you so much!!
Samantha