A
Alex St-Pierre
Hello,
I have a problem with a macro. I have create a lot of
excel file which create an operation when you open each of
them for the first time. (with the use of Private Sub
workbook_open()). If you open any of them for the first
time, the operation (form) is create succesfully. I have
create a macro to open, save and close all of them but the
results is very bad because it doesn't produce the same
thing as if it was done one by one. The macro #1,2 and 3
(see below) are not execute until the end. I think vba is
jumping some step when it open the form and then, it save
and close the form without finishing the operation.
Sub macrofortheopening-closeofexcelfile-oneatthentime()
For(each excel file)
Workbooks.Open FileName:=path & "\" & file (see below)
ActiveWorkbook.Save
ActiveWorkbook.Close
Loop
End Sub
This is my procedure at the opening of each excel file:
Private Sub workbook_open()
If(if first time opening)
Macro #1
Macro #2
Macro #3
End If
endsub
I have a problem with a macro. I have create a lot of
excel file which create an operation when you open each of
them for the first time. (with the use of Private Sub
workbook_open()). If you open any of them for the first
time, the operation (form) is create succesfully. I have
create a macro to open, save and close all of them but the
results is very bad because it doesn't produce the same
thing as if it was done one by one. The macro #1,2 and 3
(see below) are not execute until the end. I think vba is
jumping some step when it open the form and then, it save
and close the form without finishing the operation.
Sub macrofortheopening-closeofexcelfile-oneatthentime()
For(each excel file)
Workbooks.Open FileName:=path & "\" & file (see below)
ActiveWorkbook.Save
ActiveWorkbook.Close
Loop
End Sub
This is my procedure at the opening of each excel file:
Private Sub workbook_open()
If(if first time opening)
Macro #1
Macro #2
Macro #3
End If
endsub