Results 1 to 9 of 9

Thread: Publishing an application to use it in an other computer

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2021
    Posts
    39

    Unhappy Publishing an application to use it in an other computer

    hello guys,

    i'm trying to publish an application so i can use it in an other computer and i'm following the steps in this link:

    https://docs.microsoft.com/en-us/dot...ots=dotnet-5-0

    The problem is that the version that i get when i debug from the application visual studio and the one that it's published doesn't work exactly the same way even thought i save the changes that i make before publishing.

    the difference is that when i debug the app from visual studio i get the msgbox to save the changes in the files with no probleme and the app works just fine but the version published i get the msgbox to save changes behind all the apps like in the picture (it shows behind the application) .
    Name:  pic.PNG
Views: 241
Size:  42.7 KB
    the problem is that my application actually shows a datagrid and because the msgbox shows behind the app i can't do anything with the datagrid because it's suppose to show in front the datagrid like this :
    Name:  pic2.PNG
Views: 305
Size:  10.2 KB

    does anybody knows how to solve this problem and thank you sooooo much

    my code is so long so i'm gonna show the most important parts :

    Code:
    Imports Microsoft.Office.Interop.Excel
    Imports Microsoft.Office.Interop
    Imports System.Windows.Forms.OpenFileDialog
    Imports System.Windows
    Imports System.IO
    Imports System.Text
    Imports System.Windows.Forms.DataGridView
    Imports System.Drawing
    Imports System.Drawing.Color
    
    Public Class Form1
    
        Dim xlworkbook As Excel.Workbook
        Dim ws1 As Excel.Worksheet
        'Dim workbook As Excel.Workbook
        Dim xlWorkSheet As Microsoft.Office.Interop.Excel.Worksheet
        Dim xlApp As Microsoft.Office.Interop.Excel.Application
    
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            xlApp = New Microsoft.Office.Interop.Excel.Application
            OpenFileDialog1.ShowDialog()
            TextBox1.Text = OpenFileDialog1.FileName
            xlworkbook = xlApp.Workbooks.Open(TextBox1.Text)
    
            For Each xlWorkSheet In xlApp.Sheets
                ComboBox1.Items.Add(xlWorkSheet.Name)
            Next
        End Sub
     Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
            Dim ws1 As Excel.Worksheet
            work1 = xlApp.Workbooks.Open(TextBox1.Text)
            ws1 = work1.Worksheets(ComboBox1.SelectedItem)
    ' here i change the color of some cells and add them to a data grid in Form2 and i show the form 2 when the value in the cells that i changed the color for
    
     Form2.Show()
                work1.Close()
                xlApp.Quit()
                System.Runtime.InteropServices.Marshal.ReleaseComObject(xlApp) : xlApp = New Microsoft.Office.Interop.Excel.Application
                System.Runtime.InteropServices.Marshal.ReleaseComObject(work1) : work1 = Nothing
                System.Runtime.InteropServices.Marshal.ReleaseComObject(ws1) : ws1 = Nothing
    
    end sub 
    
    end sub
    Last edited by highfly884; Sep 29th, 2021 at 07:28 AM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Publishing an application to use it in an other computer

    Show us the code. That's never something we should have to ask for.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2021
    Posts
    39

    Re: Publishing an application to use it in an other computer

    i added the code thank you for reminding me

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Publishing an application to use it in an other computer

    Please fix the closing tag so that it formats properly.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Publishing an application to use it in an other computer

    Also, point out exactly where the issue is. I don't see where you're displaying a message box.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    Member
    Join Date
    Sep 2021
    Posts
    39

    Re: Publishing an application to use it in an other computer

    the message box is not created bye me it's in the savingpart where it asks me if i wanna save changes to my existing file ( so i guess it's displayed bye this part System.Runtime.InteropServices.Marshal.ReleaseComObject(work1)

  7. #7

    Thread Starter
    Member
    Join Date
    Sep 2021
    Posts
    39

    Re: Publishing an application to use it in an other computer

    i'm actually new to vb.net so i may be just guessing but i think that the problem is with where i'm creating or teh way i'm creating my xlApp . it's because i wanna work with my app multiple times with different worksheets. do you think that where i'm placing the creating of my xlapp is right ?

  8. #8
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,733

    Re: Publishing an application to use it in an other computer

    I think you need to set the DisplayAlerts property of the Excel application to False

  9. #9

    Thread Starter
    Member
    Join Date
    Sep 2021
    Posts
    39

    Re: Publishing an application to use it in an other computer

    the displayalerts is to hide the message to save the file but i still want it to show don't wanna hide it. i just don't want it to shows behind the application

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width