Resolved How to edit excel file that include at the project

Tamiryosef

Active member
Joined
May 2, 2022
Messages
36
Programming Experience
1-3
Hello to all
I am new at visual basic.
I build windows form that get data and stored it on firebase.
Now I try to get the data the user enter also go to a invoice that I build on excel.
I added the excel invoice to my project resources library , the excel form is open.

How I can use the code to edit the excel form that add to the project?

I want to add the textbox that the user enter to be add to the excel form that open in my resource library?
Screenshot_20220502-212456_Gallery.jpg
 
yes the file is under File\Excel
the message i get it that he show this path "\bin\Debug\File\Excel\Invoice Template.xlsm. "

i add the code at the NewOrderScreen.Designer.vb

i have Form1 that you can access to the form call NewOrderScreen


333.jpg

44.jpg
 
It's like you're trying to make this as difficult as possible. You've actually got the right path now and you go and put it in the designer code file. WHY would you do that?! Don't touch the designer code file unless there's a specific issue with it. Put it where you put the rest of the code.
 
It's like you're trying to make this as difficult as possible. You've actually got the right path now and you go and put it in the designer code file. WHY would you do that?! Don't touch the designer code file unless there's a specific issue with it. Put it where you put the rest of the code.

i do it and i get the same message i lose my mind!!!

555.jpg
 
I'm losing my mind too because you're not doing the simplest things. Did you look at what files actually contains, because you certainly haven't told us? Did you call File.Exists with that path?
 
i try to run this and he say file exists

i remove the file form the folder and he still say file exists

module:
Module Module1

    Sub main()

        Dim filename As String = "C:\InventoryApp new\InventoryApp\InventoryApp\File\Excel\InvoiceTemplate.xlsm"
        If File.Exists(filename) Then
            Console.WriteLine("File exists")
        Else
            Console.WriteLine("File exists")
        End If




    End Sub
 
This is ridiculous. You're now hard-coding the wrong path instead of using Path.Combine to create the right path and you're displaying the same message whether the file exists or not. I can't do this any more.
 
my mistake i fix the code to check if the file exists or not.
it and now it show me the file is not exists at the path that i check,but i see the file at my folder in my project

i fix the file name ,and now that i run the code he show my that file exists

but when i run the program he fail and give me error
 
i do what you ask ,and you are correct the file not exists

i use this code to check but i don't understand if i see the file at my folder and my project why i don't
Moudel:
Module Module1

    Sub main()

        Dim filename = IO.Path.Combine(Application.StartupPath, "File\Excel\Invoice Template.xlsm")
        If File.Exists(filename) Then
            Console.WriteLine("File exists")
        Else
            Console.WriteLine("File not exists")
        End If




    End Sub


End Module
see it when it build the project

777.jpg
 
ok i get it now it working ,OMG o_Oo_Oo_O
i need to chance the property of the file to this

build action to content
and
copy to output to copy always

thanks for you help sir :)


888.jpg
 
Back
Top