Nightlytic
Member
''' Please ignore I just found out the buttons I was using also had hyperlinks,. Figures you can have both a macro and a hyperlink attached to one button
Works now... sorry
Can someone help me please? My macro fails at the very start, extract below, thing is it works perfectly from the VBA console, but not when mapped to a button within workbook x
Sub ImportFiles()
'Declare this workbook (workbook running the macro) x, export as z and import as y
Dim x As Workbook
Dim y As Workbook
Dim z As Workbook
Set x = ThisWorkbook
'### Open export file, parse first column ###
Set z = Workbooks.Open(x.Sheets("Import Files").Range("K17"))
'Operations
End Sub
The red line is the problem, all I want is to set z as the workbook I open, file path to that is contained in workbook x, sheet import files, in cell K17. This works from the VBA console but not in a button (the file doesn't open) I just don't know what's wrong with it it seems logical and I had this exact same start work in another workbook....
Works now... sorry
Can someone help me please? My macro fails at the very start, extract below, thing is it works perfectly from the VBA console, but not when mapped to a button within workbook x
Sub ImportFiles()
'Declare this workbook (workbook running the macro) x, export as z and import as y
Dim x As Workbook
Dim y As Workbook
Dim z As Workbook
Set x = ThisWorkbook
'### Open export file, parse first column ###
Set z = Workbooks.Open(x.Sheets("Import Files").Range("K17"))
'Operations
End Sub
The red line is the problem, all I want is to set z as the workbook I open, file path to that is contained in workbook x, sheet import files, in cell K17. This works from the VBA console but not in a button (the file doesn't open) I just don't know what's wrong with it it seems logical and I had this exact same start work in another workbook....