xlsm

How to extract sheet from *.xlsm and save it as *.csv in Python?

你离开我真会死。 提交于 2020-07-29 06:26:26
问题 I have a *.xlsm file which has 20 sheets in it. I want to save few sheets as *.csv (formatting loss is fine) individually. Already tried xlrd-xlwt and win32com libraries but could not get through. Can anybody please provide a code snippet which does the above processing in Python? I have other python dependencies so no other language would work. Thanks 回答1: xlrd should work fine on xlsm files as well. I tested the code with a random xlsm file, and it worked perfectly. import csv import xlrd

is there any way to create a .xlsm file from scratch in python?

爷,独闯天下 提交于 2020-01-11 10:49:16
问题 I am using python 3.8.1 on a mac and am trying to create a .xlsm file from scratch. I have looked at openpyxl and xlsxwriter, both of them are able to create .xlsx files from scratch and both can edit existing .xlsm files but I can't find any thing about actually creating a .xlsm file from scratch. I've looked over the openpyxl documentation here and the xlsxwriter documentation here but I have not been able to find anything about how to create a .xlsm file from scratch. I can't even find

paste special values in vba

独自空忆成欢 提交于 2020-01-11 09:52:15
问题 I am working on a small project which requires me to copy and paste certain columns if I detect "true" in the row. I am trying to paste these selected columns onto a different sheet and I want to paste only their values not the formulas. This is what I have so far and I am getting an error with the paste special feature. Please help. ' CopyIfTrue() Dim Col As Range, Cell As Excel.Range, RowCount As Integer Dim nysheet As Worksheet Set nysheet = Sheets.Add() nysheet.Name = "T1" Sheets(

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

Library for C# to read Excel 2007 xlsm file?

强颜欢笑 提交于 2020-01-05 02:51:26
问题 Does someone know library for C# to read xlsm file (Excel 2007 with macro) ? I've downloaded EPPlus, it read xlsx files but it has an error New line format. Thanks 回答1: Infragistics.Excel can read and write .XLSM files. Note, that this library requires .NET Framework 3.0 to support Microsoft Excel 2007. 来源: https://stackoverflow.com/questions/6336803/library-for-c-sharp-to-read-excel-2007-xlsm-file

How to find out what makes poi corrupt a xlsx / xlsm file

有些话、适合烂在心里 提交于 2020-01-03 02:48:25
问题 I have the issue that Apache POI "corrupted" a xlsm / xlsx file by just reading and writing it (e.g. with the following code) public class Snippet { public static void main(String[] args) throws Exception { String str1 = "c:/tmp/spreadsheet.xlsm"; String str2 = "c:/tmp/spreadsheet_poi.xlsm"; // open file XSSFWorkbook wb = new XSSFWorkbook(new FileInputStream(new File(str1))); // save file FileOutputStream out = new FileOutputStream(str2); wb.write(out); wb.close(); out.close(); } } Once you

Automatically run data connections in XLSM

∥☆過路亽.° 提交于 2019-12-25 09:19:15
问题 I have an XLSM file which contains 2 Web Query connection. When I go to "Connections" in the "Data" tab I am presented with the two connections I have. For each of these I can edit some properties, one which says "Update every X minutes". I've set this to 1 minute and also ticked "Activate background update". This, however, won't work as the web query connections aren't run anyway. Ultimately what I need is to run these connections automatically once every hour. Preferably without any user

Read and write a xlsm file using exceljs package npm

家住魔仙堡 提交于 2019-12-24 02:31:25
问题 I have a xlsm file with few data already in it and need to write some data and create a new xlsm file during automation. With below code the file gets created , but it becomes corrupt and unable to open. File size reduces, for ex from 8kb to 7kb. Not sure what is getting missed while writing the file. var Excel = require('exceljs'); var workbook = new Excel.Workbook(); workbook.xlsx.readFile('Book.xlsm') .then(function () { var worksheet = workbook.getWorksheet(1); var row = worksheet.getRow

“ThisWorkbook.Close” Causes excel to crash

孤街浪徒 提交于 2019-12-23 10:15:25
问题 I have a large collection of excel files that work almost like a program, and they run on multiple computers (with different versions of windows), and as of latelly I have this bad problem, when the user presses my close button (actually a picture I associate a macro with), with the code calls: ThisWorkbook.Close savechanges:=True It causes 2 of the 4 supported computers to crach EXCEL (Windows XP = OK, Windows 10 = OK 1 BAD OTHER, Windows 8 = BAD). I have isolated the incident to this