No joy but that's becuase I'm dumb and don't really know what I'm doing!
I've recorded a new macro called 'saving' as you specified
Sub saving()
Dim stWbName As String
stWbName = ActiveWorkbook.Name
End Sub
I have replace all references to Windows("Packaging tool Version 4.xls").Activate with stWbName.Activate
I run the macro and it runs (don't see any errors) but when I try to run the macros in the workbook (for example on called Primary) I now get a different error than before.
If I have the 'saving' macro as a macro in it's own right I get the error 'Runtime Error 424 Object Required' and it points to the first line in the 'Primary' macro that says ' stWbName.Activate'
I thought this might mean that I need the code for the 'saving' macro as part of the 'Primary' macro so included the code at the beinging of that particular macro. So the code reads:
Sub Primary()
Dim stWbName As String
stWbName = ActiveWorkbook.Name
ActiveSheet.Shapes("Chart 7").IncrementLeft -13.5
ActiveSheet.Shapes("Chart 7").IncrementTop 15#
ActiveWindow.Visible = False
stWbName.Activate
etc.
When I run this I get 'compile error - Invalid qualifier' and the debugger points to the line 'sub Primary()'
Any suggestions. Apologies for being dumb - you can tell I don't usually mess with macros
Bookmarks