0

Hi there,

I was trying to edit a excel document and save under different name and my coding for this is as follows.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


        'Open
        Dim MyExcel As New Excel.Application
        MyExcel.Workbooks.Open("C:\Test\WalkAir.xlsx")

        'Extract
        MyExcel.Sheets("sheet1").Activate()
        MyExcel.Range("A99").Activate()

        MyExcel.ActiveCell.Value = TextBox1.Text


        MyExcel.SaveAs("C:\Test\alkAir.xlsx")
        MyExcel.Workbooks.Close()
        MyExcel = Nothing

    End Sub

While debugging the code it resulting with me an error message as Public member 'SaveAs' on type 'ApplicationClass' not found.

I would be much obliged if you can help me in this issue.

Best Regards

2
Contributors
3
Replies
5
Views
5 Years
Discussion Span
Last Post by Reverend Jim
0

Just use the SaveWorkspace method with the desired filename.

It result with me the same error

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.