Extract, save, and archive a file

Hello

I would like to use a macro in vba on excel, to extract a file when opening it, save it and then archive it.

At the moment, I know how to extract a file via a macro (with unlock_file) the same to archive, but I don't know how to extract the open file and archive this same file. The file is open and cannot be archived.

I think there is a solution since I have the Enterprise PDM add-in that allows me to do this with the click of a button.

Do you have any ideas for generating this code?

Thank you in advance for your answers.

 

Ciao

Hello, I may misunderstand the question but why do this? You can simply "extract" and then "archive" directly from the vault. otherwise in solid you can choose that the files are extracted as soon as they are opened!. Why open the file, extract it, save it and then archive it??? Knowing that saving it will only create a local file on your computer, nothing more.

 

Kind regards

Good evening

From excel impossible. As soon as the file is opened in an application (whether it's SW or something else, depending on the files), the vault prohibits any action.

Only the functions of the add-in in SW are functional as explained by G.

If the need lies in modifying variables and applying them to a file, it is possible but you have to proceed like this:

  1. Extract the file
  2. Update the desired variables
  3. Open the file in SW
  4. Save it (rebuild it if necessary)
  5. Close File
  6. Archive the file with a comment

All this is done from excel.

Otherwise, by playing with excel and the SW task scheduler, it can be played without the constraint of opening SW via excel.

Hello

The goal is to manipulate an excel file, not a SW file.

The goal is to modify an excel file, which retrieves variables from files that are pasted to it as a reference, then save this file (to do this, you have to extract it), then archive it. All this automatically with macros in the said Excel file.

So I need to extract an Excel file when it is open (I succeeded), but I would like to archive this same file.

I think it's possible because there is a pdm add-on for excel to do it.

The question is, how does the automated in vba

 

 

Good evening

Add-ons are not accessible via vba but via full-fledged programs. So from my point of view you have to do what I described but by replacing the SW file with an excel file and therefore manage in two files.

The first one extracts the excel file and opens it, triggers the macro of this file then closes and archives.

1 Like

Hello

 

Cyril.f, I had thought of this solution. I want to avoid it. If it's feasible with an add-on, it should be doable via VBA (without necessarily launching the add-on) but by reproducing the function.

 

In that case, I'll let you look for it. I have already answered on the fact that via vba it is not possible to extract an open file.

Add-ons are more advanced and only a VB.NET or C# code allows access to these functions, so exit vba.

2 Likes