| || |
Dealing with an Excel file
I have the following code:
Set oExcel = createobject ("Excel.Application")
oExcel.Cells(1, 1).Value = "Test value"
the problem with this code is that it does not open test.xlsx file only but Book1.xlsx along with it. I do not have any Book1.xlsx file. If I keep running the same code 3 times, I noticed that Book1.xlsx, Book2.xlsx, and Book3.xlsx were created. What am I doing wrong? Why does book1.xlsx get created?
Please note that the value “Test Value” is added to the sheet, but not to test.xlsx where it is supposed to be; it is added to Book1.xlsx. It is really strange.
Re: Dealing with an Excel file
It is because of below statement
You are requesting excel to add a new blank workbook which comes as BookX.xlsx