activexobject

How to control Excel column size in Javascript?

旧时模样 提交于 2020-01-06 21:41:38
问题 I have a function in Javascript that Exports data to a new Excel file. I'm using ActiveXObejct("Excel.Application") to work with Excel. After The Export of the data is done and I see the result, the data overflows the width of the columns. This is causing some of the data look cut in the table. For example if I have the data '1234567890' in a cell I would see '123456' or '######' in the cell. So how can I control the width of the columns to fit the data they contain? This is a code example of

How to control Excel column size in Javascript?

爷,独闯天下 提交于 2020-01-06 21:41:12
问题 I have a function in Javascript that Exports data to a new Excel file. I'm using ActiveXObejct("Excel.Application") to work with Excel. After The Export of the data is done and I see the result, the data overflows the width of the columns. This is causing some of the data look cut in the table. For example if I have the data '1234567890' in a cell I would see '123456' or '######' in the cell. So how can I control the width of the columns to fit the data they contain? This is a code example of

Issue downloading .xlsm document with activex controls using NPOI

十年热恋 提交于 2020-01-06 15:52:50
问题 I am trying to implement an excel file download functionality in my asp.net MVC application and using NPOI. The file has three sheets and Sheet2 has two activex buttons. I am reading the source file, adding values to sheet2, save it in temporary location and download the file later using the following code. using (var fs = new FileStream(xlsFilePath, FileMode.Open, FileAccess.Read)) { var templateWorkbook = new XSSFWorkbook(fs); //Sheet update operation done here fs.Close(); var memoryStream

Issue downloading .xlsm document with activex controls using NPOI

ぃ、小莉子 提交于 2020-01-06 15:52:08
问题 I am trying to implement an excel file download functionality in my asp.net MVC application and using NPOI. The file has three sheets and Sheet2 has two activex buttons. I am reading the source file, adding values to sheet2, save it in temporary location and download the file later using the following code. using (var fs = new FileStream(xlsFilePath, FileMode.Open, FileAccess.Read)) { var templateWorkbook = new XSSFWorkbook(fs); //Sheet update operation done here fs.Close(); var memoryStream

ActiveX Control always working on my machine - unpredictable behavior on others?

随声附和 提交于 2020-01-06 12:45:54
问题 I have a question about my ActiveX control not always working in IE on other machines. Context: I'm working on an internal app for my company. It is designed to be a standalone web-page config tool for viewing a static customized version of our web app. The user may select the colors, images, and other settings they would like to see, and these will be present in the static mockup/preview version on their machine when they click a button. Implementation: my javascript file creates a

Excel ActiveX Listbox not enabled on file open

心不动则不痛 提交于 2020-01-01 08:38:42
问题 I am trying to figure out a bizarre situation. I have a workbook with many sheets. On one sheet, I have one ActiveX listbox (CTOverview.Listbox1). On a second sheet, I have a total of three listboxes (CTSelected.Listbox1 thru Listbox3). I am using a query to populate Listbox1 on both sheets with the same data. The code for this is below: strSQL = "Select Distinct [Region] From [UniqueCTList$] Order by [Region]" closeRS OpenDB ' initialize listboxes CTSelect.ListBox1.Clear CTSelect.ListBox2

JavaScript ActiveXObject

淺唱寂寞╮ 提交于 2019-12-25 02:18:34
问题 I have a queastion about ActiveXObject in javascript. I have tryed this code in Mozila FireFox 6.0.2 var AXobj = new ActiveXObject("WScript.Shell"); AXobj.SendKeys(key); But the error console says that ActiveXObject is undefined. After that, I have tryed this: var AXobj = new DOMParser("WScript.Shell"); AXobj.SendKeys(key); But then, the error console says: Error: uncaught exception: [Exception... "Security error" code: "1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)" location: "file

Create object WMPlayer.OCX issue

南笙酒味 提交于 2019-12-25 01:14:05
问题 I am using following code in my HTML page but it is returning NULL. (IE8 , MS WIndows 7 Pro) Set Sound = CreateObject("WMPlayer.OCX") I am sure Windows Media Player is installed and working fine. How to fix it? 回答1: It seems like is impossible to use Visual Basic code like I use in HTML. Instead of it we have to use Windows Media Player in DOM like this <body onload='' scroll="no"> <object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="WindowsMediaPlayer" width="0" height="0"> <

How to extract images from Word documents using JavaScript?

若如初见. 提交于 2019-12-24 19:24:54
问题 I am trying to extract images from Word documents using the ActiveXObject in JavaScript (IE only). I was unable to find any API reference for the Word object, only a few hints from around the Internet: var filename = 'path/to/word/doc.docx' var word = new ActiveXObject('Word.Application') var doc = w.Documents.Open(filename) // Displays the text var docText = doc.Content How would I access images in the Word doc using something like doc.Content ? Also, if anyone has a definitive source

Open Word from javascript and bring to front

让人想犯罪 __ 提交于 2019-12-24 00:59:40
问题 I'm using the following code to open a Word document from javascript: function openWord(file) { try { var objword = new ActiveXObject("Word.Application"); } catch (e) { alert(e + 'Cannot open Word'); } if (objword != null) { objword.Visible = true; objword.Documents.Open(file); } } This works fine the only problem is that the Word application does not come to the front when opened, instead it opens just behind the browser. Is there a way to force Word to open on top of any other window? or to