karthikeyan
karthikeyan

Reputation: 39

Runtime error 1004 (Excel file not opening)

I have an Excel file with a filename

CONSULT CHECKING SYSTEM (2.0L TURBO GASOLINE ENGINE)

When I try to open using vba code, this file it is not accepting decimal characters (2.0). When I removed decimal characters it is opening perfectly. How to make it accept decimal characters?

This is the code I am using to try to open the file:

"C:\Users\karthi\Desktop\New folder (2)" & "\" & Cells(i, 1).Value

cells(i,1).value will have CONSULT CHECKING SYSTEM (2.0L TURBO GASOLINE ENGINE)

Why is it not accepting decimal number?

Upvotes: 0

Views: 54

Answers (1)

user3598756
user3598756

Reputation: 29421

add to the file name its "extension", too:

Workbooks.Open"C:\Users\karthi\Desktop\New folder (2)" & "\" & Cells(i, 1).Value & ".xlsx")

Upvotes: 2

Related Questions