amitziti
08-22-2020, 02:41 PM
hello,
im trying to write a vba code to open other excel workbook that every month changing the name in the number of the month.
i want that excel will open the workbook automaticly and im getting error that it cant find the file.
this is the code that i wrote:
sub macro1
dim myname as string
myname = inputbox ("write the number of the month")
myfileorly = "orly" & myname
chdir "f:\excel"
workbooks.open filename:= _
"f:\excel\myfileorly.xlsx"
end sub
im trying to write a vba code to open other excel workbook that every month changing the name in the number of the month.
i want that excel will open the workbook automaticly and im getting error that it cant find the file.
this is the code that i wrote:
sub macro1
dim myname as string
myname = inputbox ("write the number of the month")
myfileorly = "orly" & myname
chdir "f:\excel"
workbooks.open filename:= _
"f:\excel\myfileorly.xlsx"
end sub