Jump to content

Recommended Posts

Hi guys,

I want to use Vi to format convertion, that .mht to .xlsx of Excel, or .html to .xlsx of Excel, Input path of file, output path of .xlsx.

I try to  find active X to realize the target, but I can not find.

I don't know what to do.

Share this post


Link to post
Share on other sites

Post what you've tried so far.  Normally I'd suggest using the report generation toolkit with the template path, being the path to the original file, and then use the Save Report with the new path, but I'm guessing you mean you want to save a table which is in the HTML file, but without an attached file it is hard to say.  Post what you have, post what you've done, and post what you want the output to be.  This will likely involve ActiveX and/or the report generation toolkit, but there just isn't enough information to answer your question.

Share this post


Link to post
Share on other sites
6 hours ago, hooovahh said:

Post what you've tried so far.  Normally I'd suggest using the report generation toolkit with the template path, being the path to the original file, and then use the Save Report with the new path, but I'm guessing you mean you want to save a table which is in the HTML file, but without an attached file it is hard to say.  Post what you have, post what you've done, and post what you want the output to be.  This will likely involve ActiveX and/or the report generation toolkit, but there just isn't enough information to answer your question.

   Hi hooovahh, Thanks your answer.

   I had achieved html to mht(MHTML) so far (below 01 HtmlToMht_0A.vi), then I want converting between mht and xlsx(Excel), or html to xlsx straightly, at last the VI output path of xlsx.

01 HtmlToMht_0A.vi

Share this post


Link to post
Share on other sites

The following file in the report generation toolkit performs the Save As function:

<vi.lib>\Utility\NIReport.llb\Excel\Save Report to File.vi

It has a case constant that uses the following values, I'm unsure if these same values can be used for the document save function.

xls -4143

xlt 17

htm, html 44

xlsx 51

xltx 54

xlsm 52

pdf 57

csv 6

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Similar Content

    • By Gab
      Hello,
      Is it possble to put signatureline into excel footer using Active X ?
    • By Christian Butcher
      Firstly, I'm reposting from the NI Forums here: Programatically reinsert an ActiveX Container
      TL;DR: My goal is to programmatically carry out whatever happens when I right click on an ActiveX container and choose the option 'Insert ActiveX Object...'. Ideally, I would like to avoid using VI Scripting to do this, but I haven't gotten anywhere so far and so really any solution will be a step forwards.
      My most recent attempt (I'm using NI's Actor Framework) has been to place the ActiveX container on an Actor Core panel, then use Pre-Launch Init to open a Static VI Reference, and resize the front panel, with the container set to scale with the front panel. This doesn't work, because the static reference doesn't refer to the same thing that the AF then opens using the Launch Actor VI, but ignoring that problem, it also doesn't help with resizing the container.
      Previously, I manually resized the container, but this I could only do after it was in existence, and so the object was already inserted.
      My current observation seems to be that after I choose the ActiveX object to insert, there is little/nothing I can do to change the size of the object (I can change the container, but this doesn't do anything to the object - probably the object isn't very friendly-ly coded, but I can't do anything about that...). Consequently, I come back to my goal, which is to call some Invoke Node or similar, to 'Insert ActiveX Object...'.
      Is there some way to do this? I don't intend to do it often, so long execution times, recompilation of VIs, shooting a cow over the moon are all fine if needed.
    • By piZviZ
      Our client having Scada based exe application (Non LabVIEW exe.).This application gives popup for saving pdf report file,So they need to write name of report every time.They don't have source code of this application.Now, they want to do automation in this. Whenever this application gives pop up for report name  it should be automatically name by external labview application.
      How it is possible using ActiveX?How to create ActiveX object for this Scada based exe? or any other ways to do this things are most welcomes .
       
    • By peter_flores
      Hello world!
      I am having a very strange issue controlling MS Excel through ActiveX from LabVIEW. I feel like it is likely not a rare task yet I find little to no helpful documentation from the MS side or NI side :/ I am a CLD and am working this project with a CLA and it has cost us over 40 hours of painstaking troubleshooting so far! I hope you can help. Here it goes...
      I am using the following setup: Windows 7 Pro LabVIEW 2015 SP1 Office 2016   I have created a simple LV class to create excel reports which works without an issue on my computer. The problem occurs when I run the code on another PC - Excel crashes ("2016-12-06_1125") and needs to restart, and usually then feeds an error back to LabVIEW("2016-12-06_1152"). This crash is asynchronous to the LabVIEW calls, meaning that a different VI will report the error each time. The problem occurs in Dev Environment and as an EXE.   I have been developing and validating on these two separate systems during the last 3 months of building this project without an issue. The only difference between systems has arisen with the Excel automation. I have now run the project on 5 or 6 machines where 2 exhibit the problem repeatedly. On the rest, I have seen the behavior, but remedy it by updating the ActiveX reference as described below.     Other systems: Works: Win 7, LabVIEW 2015 SP1, Office 2013, .NET 4.6.1;           Win 10, Office 2016, LabVIEW 2015 SP1, .NET 4.6.2 Does not work: Win 10 (.NET 4.6.2), LabVIEW 2015 SP1, Office 2016;     Win 10, LabVIEW 2015 SP1, .NET 4.6.1, Office 2016   "Version 1.3"   A strange behavior that must be related, but I have not been able to exactly correlate it with good or bad behavior is shown in the other two screenshots attached. "Version 1.9" shows the .NET library that should be selected. Occasionally, this appears as shown in "Version 1.3", which looks like garbage - it is hard to tell what library that eve is supposed to be and why it would switch on it's own. We have tried setting this as a constant, control, typedef, with no luck in locking it down and keeping the "Version 1.3" behavior at bay.   Related Post? In doing a lot of googling and research, I have not seen much info on this. Though this post looks like it is describing a similar behavior, though not exactly the same.    Thank you in advance for your help! This is holding up delivery of a $50k LabVIEW job that is scheduled to be delivered by Dec 15 and is looking unlikely because of this bug/anomaly, please help! (you know, the last 10% rule, ahhhh!)  



    • By styrum
      Now that it looks like Microsoft deprecated ActveX Automation interface in Excel 2016, the only other interface left is .NET interop assemblies. I have tried to reproduce Excel - Write Table.vi using .NET instead of ActiveX. The result of the effort is attached. There is a big problem though: The Range.value2 property could take 'anything' without a problem when using ActiveX (it was taking any variant)! But now it wants a .NET object. And the 'To .NET Object.vi' doesn't accept a 2D array of variants! So, say getting a recordset from a database (which is returned as a 2d array of variants) and then writing it, as it is, to a new Excel workbook is no longer possible as far as I understand. This is really sad. A 2D Table of strings or doubles is still OK. So, if you need to use those, you can with the attached code
      Write Table to Excel with DotNET.vi
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.