Hi im just a new here and Im hoping that you can help me. Im having a problem in my project and I cant find any solution in the internet thats why i am hopeful that in this forum somebody will help me.
this is my codes

Private Sub cmdupdate_Click()
Set oapp = Excel.Application
Set oWB = oapp.Workbooks.Add
Set excelWS = Excel.Worksheets("Sheet1")
NewRow = range("A").End(xlDown).Offset(1, 0).Row
oapp.Sheets("Sheet4").Cells(NewRow, 1).Value = txtclient.Text
oWB.SaveAs ("C:\140410.xlsx") ' <-- method or data member not found.

and it highlighted the word .saveas
should i declare it or what?
advance thank you guys.

Edited by pritaeas: Added markdown.

3 Years
Discussion Span
Last Post by ice23

Let me give additional information about my project. I have a project that needs to insert data in my existing excel file using textbox. but with the codes that I posted above, I cant continue in my project because of that. so please help. I need to finish this. please any help will be highly appreciated


yes, bcause its already an existing excel file.


Hi guys. I made it, I manage to input data in my existing excel file. but there is still one problem. I dont know how to determine the empty row where my next data will be inserted. I need help guys. I am hopeful to any suggestion. thanks in advance.



This is my code in inserting data in my excel file but the problem is everytime i will execute this Im having an error but still the data is inserted to my excel.

    Selection = txtclient.Text ' having an error here run time error 91: object variable or with block variable not set
    Selection = txtbooknum.Text
    Selection = txtimp.Text
    Selection = txtauthor.Text
    Selection = txtpen.Text

hi pritaeas, thanks for your reply. I try to change wrkSheet.range to wrkSheet.Selection but I got an error: method or data member not found.


ah honestly I just got that code in a thread. so I really dont have any Idea.


yes its still returning anything but after that it will show the error.


hey good day! all I just want to know and to learn is how will I put the data in the excel cells without declaring were will it go. I mean the program needs to know or trace the next empty row. is that possible. how will i use range to do it? hope you understand my explanation. thanks alot..


hi guys I made it to insert data inmy excel file and also the range. but I problem because when I clickthe command button to insert data in myexcel file the data will fall to the last empty cell of the sheet. so how will I make it to the first empty cell of the sheet. this is the code that im using.


please guys...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.