Problem with macro

filipivanovic

Board Regular
Joined
Oct 25, 2013
Messages
54
Hi, i have problem with macro but can not figure out what is the problem. This is macro:

Sub GoTo_Material()
Path = "C:\Users\rsivafil\Documents\MRP Obuka\MRP01\"
Row = ActiveCell.Row
mat_index = Range("a" & Row).Value
mat_name = Range("b" & Row).Value
file_name = Path & "MRP_" & mat_index & "_" & mat_name & ".xls"
On Error GoTo kupa

Workbooks(file_name).Activate
Exit Sub
kupa:
Workbooks.Open (file_name)

End Sub


What can be done ?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Does not work :(
When i go manually to file it opens with no problem. But through macro it is not working, but i have some other files that are working normaly.
 
Upvote 0
The problem is that file does not open through marco. But it opens when i double click on file.
I have many similar files in foleder and only this one i problematic.

When i click debbug i get macro i attached. That Workbooks.Open (file_name) is marked with yellow
 
Last edited:
Upvote 0

Forum statistics

Threads
1,222,415
Messages
6,165,894
Members
451,993
Latest member
rowebca

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