Windows 10: To write an Excel file from a VB.Net programme.

Discus and support To write an Excel file from a VB.Net programme. in Windows 10 Network and Sharing to solve the problem; Hi, I have made an application in Visual Studio 2017 that generates an SQL-express database (Database.mdf). The database is read by the programme and... Discussion in 'Windows 10 Network and Sharing' started by Per Söderberg, Oct 9, 2019.

  1. To write an Excel file from a VB.Net programme.


    Hi,

    I have made an application in Visual Studio 2017 that generates an SQL-express database (Database.mdf).

    The database is read by the programme and the data are sent to an Excel file and the Excel file is written on an USB-Stick . This works fine at my developer unit, with Windows 10 and Excel is installed.

    But when I transpose the programme to the target machine and starts the making of the Excel file I get an exception, Cannot create ActiveX Object.

    The target machine is Windows 10 IoT and has not Excel installed. The idea being to have as little as possible of software on the target machine.

    The code is:


    objExcel = CreateObject("Excel.Application")
    objExcel.Visible = True
    objExcel.AddIns("QzData Excel Addin").Installed = True
    objBook = oExcel.Workbooks.Add


    The third line makes no difference but I searched for solution and found that the error may be that there are error controls built in Excel that may kick in and that it would be fixed by the AddIns!? I also tried to write the Excel file to C:\Users\Public but the same error was received as when I tried to write to an USB-stick.

    I would appreciate any help to get this solved.

    Best Regards,

    Per

    :)
     
    Per Söderberg, Oct 9, 2019
    #1

  2. FIles in Word, Excel and other programmes will not open from the explorer

    Hi Brian,

    Thank you for posting in Microsoft Community and thanks for providing us an opportunity to assist you.

    Please follow the steps.

    Step 1:

    Lets try to disable the DDE option following these steps:

    • Click the File tab, and then click
      Options.
    • Click Advanced, and then click to clear the
      Ignore other applications that use Dynamic Data Exchange (DDE) check box in the
      General area.
    Click OK.

    Step 2:

    If the issue persists, uncheck the compatibility options by doing the following:

    Right click on Excel (.exe) Properties > Compatibility > uncheck all the boxes

    To access Excel (.exe), open the following location:

    Windows 8 32bit: C:\Program Files\Microsoft Office\Office14

    Windows 8 64bit: C:\Program Files(x86)\Microsoft Office\Office14

    For reference:
    http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/there-was-a-problem-sending-the-command-to-the/56ee1743-b476-43a5-9b00-169b8c6ef37a


    Hope the suggestion is helpful. Reply for further assistance.
     
    Joy Kemprai, Oct 9, 2019
    #2
  3. VBS Msgbox

    Denis,

    • I was too lazy to compute the size programmatically. And, it the 2005 version the message box always came up hidden, so I always used 0 for the top. It's also part of my OCD to be able to control everything.
    • I personally don't need it to timeout. I used this in vbs files to ask to continue to the next step, skip the next step or cancel the vbs. BTW, I added the code back in but keep it assign it to 0.
    • Sound was calling Windows Media Player: WshShell.Run "C:\Users\donast\desktop\sndrec32.lnk",7,false the lnk is a shortcut on my old desktop that had: "C:\Program Files (x86)\Windows Media Player\wmplayer.exe"
      "C:\Users\Public\Music\Wavefiles\Twilight.wav"
    • Yes. The value is the number of the button in the order specified when calling it.
    • Never really thought about it as all my VBS/VBA code is relatively simple and I add comments in the file as necessary to remind me what is going on. I don't usually have anyone to share my code.
    FYI I use a VBS to call it. Here's a line from a test vbs I use to run your version:

    choice=Wshshell.run("custommsgbox.vbs " & wscript.scriptname & " ""CopyFiles.vbs done. Continue with UnArchVista.vbs?"" ""White"" ""Black"" 40 ""Yes"" ""No"" ""Cancel""",1,true)

    Copy it to a text editor to see all the spaces, etc. Took me a while back the to figure it out.

    Don
     
    DRARetired, Oct 9, 2019
    #3
  4. dalchina Win User

    To write an Excel file from a VB.Net programme.

    CSV files used to open in Excel....not now!


    Hi, you say Excel is installed. Does it run normally?

    You can't find Excel in (an unspecified) list of applications. I don't know which list that is for sure.

    For example, in the list related to:
    - rt click a file. Open With
    - this list:

    To write an Excel file from a VB.Net programme. [​IMG]

    - this list:

    To write an Excel file from a VB.Net programme. [​IMG]


    - some other list...

    If Excel does not appear in the above, I suggest you repair your office installation.

    Maybe the above gives you some ideas. Otherwise please post a screenshot of where you think you should see it but don't. Thanks.
     
    dalchina, Oct 9, 2019
    #4
Thema:

To write an Excel file from a VB.Net programme.

Loading...
  1. To write an Excel file from a VB.Net programme. - Similar Threads - write Excel file

  2. vb

    in Windows 10 Gaming
    vb: vbgvhj https://answers.microsoft.com/en-us/windows/forum/all/vb/83613166-f6f4-4339-851e-a5f28a93c197
  3. vb

    in Windows 10 Software and Apps
    vb: vbgvhj https://answers.microsoft.com/en-us/windows/forum/all/vb/83613166-f6f4-4339-851e-a5f28a93c197
  4. msjter35.dll can't load VB Programm Windows 10 failure

    in Windows 10 Customization
    msjter35.dll can't load VB Programm Windows 10 failure: Mein VB Programm arbeitet unter Windows 8 hervorragend. Unter Windows 10 kommen Fehlermeldungen. msjter35 can't load dll .Keine Datenbankverbindung.Die gauge.ocx ist nicht registriert.Kann mir jemand helfen um dieses Problem zu lösen?...
  5. Excell Files

    in Windows 10 Network and Sharing
    Excell Files: How do I find all my excel files created in 2020? https://answers.microsoft.com/en-us/windows/forum/all/excell-files/7152ac25-949a-4dc7-a8e4-0b77c3c31477
  6. VB

    in Windows 10 Software and Apps
    VB: How to inside o visual basic 2019 achieve the horizontal scroll with the mouse wheel. I did it with a modifier key and the mousewheel event but only work when i move the wheel down... HELP, please....
  7. excel files

    in Windows 10 Network and Sharing
    excel files: Transferred files from windows xp to windows 10. unable to open files. File System Error (-2143322102). https://answers.microsoft.com/en-us/windows/forum/all/excel-files/eda9c459-1296-4b29-bbbe-e37b2dde5c03"
  8. I need a letter writing programme

    in Windows 10 Drivers and Hardware
    I need a letter writing programme: I do not have a letter writing programme and need to write a letter today https://answers.microsoft.com/en-us/windows/forum/all/i-need-a-letter-writing-programme/1f523a1b-5805-4f06-a949-e67b8507ad8a
  9. .NET Framework Intitialization Error In Neuro-Programmer 3

    in Windows 10 Customization
    .NET Framework Intitialization Error In Neuro-Programmer 3: I switched over to a computer using Windows 10 from Windows 7, and can no longer use Neuro-Programmer 3. I keep getting the error: "Please set registry key HKLM\Software\Microsoft\.NETFramework\InstallRoot to point to the .NET Framework install location" I understand that...
  10. VB 2008

    in Windows 10 BSOD Crashes and Debugging
    VB 2008: HO INSTALLATO IL SOFT DI VISUALBASIC 8 (2008) SU WINDOWS 10 X64,ho provato a eseguire una procedura con la cponnessione dati un file di access, quando ho effettuato il debug mi appare l'avviso"si è verificato System.InvalidOperationException Messasggio="il provider...