vba PROJECTS DUPLICATES

Joke

Board Regular
Joined
Jan 21, 2004
Messages
171
I{m using a macro to open another xl save data and close it again.

After every use of hte macro the VBAproject of the other XL file remains open and I end up with many VBAprojects of the same file.

Seems the file is not totaly closed with the OpenedWB.close.........

Any idea how I can close also the VBA project everytime the file is opened en close in Excel?????


****************************************
Dim ActiveSh As Worksheet
Dim OpenedWb As Workbook
Dim strFname As String
Application.ScreenUpdating = False
If WorksheetFunction.CountA(Range("control1"), Range("cedula1")) = 6 Then
strFname = Range("ubicacion").Value
Set ActiveSh = ActiveSheet()
Set OpenedWb = Workbooks.Open(Filename:=strFname,
writeResPassword:=Sheet5.Range("password").Value)
With OpenedWb
.ActiveSheet.Range("A2").EntireRow.Insert
.ActiveSheet.Range("a2:eek:2").Value = ActiveSh.Range
("guardar1").Value
OpenedWb.Close
Application.Goto Reference:="comienzo2"
End With
Else
If WorksheetFunction.CountA(Range("control1")) < 5 Then
Application.Goto Reference:="control1"
MsgBox "Llena todos los datos "
Else
Application.Goto Reference:="cedula1"
MsgBox "llena el numero de cedula "
End If
End If
Application.ScreenUpdating = True
End Sub
**************************************

Thanks for helping me out on this one!

Joke
 
Is there a book in the xlstart? The xlstart may be under the folder where the app is installed or under your username in documents and settings. When you uninstall it will not normally ask to remove files placed after installation such as a book in xlstart or templates in your templates folder.
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I have been having the same problem for over a month now. I even had MS Office completely removed and re-loaded and it didn't help. The IT people ran a few other programs that didn't help either. Hopefully someone out there has a fix.
hi
I have the same problem can you explain how can i fix it .
 
Upvote 0

Forum statistics

Threads
1,215,743
Messages
6,126,609
Members
449,321
Latest member
syzer

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top