save-as

Excel VBA - Access Website, generate report & press save on IE dialog bar

放肆的年华 提交于 2021-01-29 16:13:09
问题 I have a question regarding a topic that is already discussed in some other threads and forums but I do not manage to make it work for me. So I came here to ask that questions concerning my individual code. Basically, I access an intranet-site and based on some input (via checkboxes) a report is created with data from SAP. My problem arises after the report is generated and IE prompts me to press the "save" button on its dialog box. I do not manage to automate that part. Could you help me

VBA code to check and create folder system and save file

对着背影说爱祢 提交于 2021-01-29 13:00:16
问题 I'm looking to create a code that takes an active worksheet which once completed and a button is selected it saves it as a new workbook within a folder / subfolder system based on multiple cell values. Some of the cells may stay the same but others may change, giving a variety of potential paths which could already part exist or not exist at all. I've managed to put a code together which does just that but when I change one of the cell values, which ultimately changes the path slightly, I get

Remove illegal characters while saving workbook Excel VBA

一曲冷凌霜 提交于 2020-08-07 06:15:09
问题 this code basically reformats an xls file and saves it as an xlsx. however it uses G2 & H2 to grab the filename for the newly formatted file. So that means certain characters can't be in the file name. I added a chunk of code to replace those characters ( ' Remove/Replace Invalid File Name Characters WkbName = Range("H2") MyArray = Array("<", ">", "|", "/", "*", "\", ".", "?", """") For X = LBound(MyArray) To UBound(MyArray) WkbName = Replace(WkbName, MyArray(X), "_", 1) Next X 'MsgBox

Macro to save only the active worksheet

∥☆過路亽.° 提交于 2020-07-14 09:51:22
问题 In the below code it saves the complete workbook. I want to save only the active worksheet. Sub sbVBS_To_SAVE_ActiveWorkbook() ActiveWorkbook.Save End Sub 回答1: Copying a worksheet to no location automatically creates a new workbook in the foreground with a copy of the worksheet as the only worksheet in the new workbook. Sub test() worksheets("sheet3").copy 'there is now a new active workbook with activeworkbook 'save it .SaveAs Filename:="some file path and filename without extension",

Macro to save only the active worksheet

本小妞迷上赌 提交于 2020-07-14 09:49:22
问题 In the below code it saves the complete workbook. I want to save only the active worksheet. Sub sbVBS_To_SAVE_ActiveWorkbook() ActiveWorkbook.Save End Sub 回答1: Copying a worksheet to no location automatically creates a new workbook in the foreground with a copy of the worksheet as the only worksheet in the new workbook. Sub test() worksheets("sheet3").copy 'there is now a new active workbook with activeworkbook 'save it .SaveAs Filename:="some file path and filename without extension",

Macro to save only the active worksheet

我怕爱的太早我们不能终老 提交于 2020-07-14 09:49:08
问题 In the below code it saves the complete workbook. I want to save only the active worksheet. Sub sbVBS_To_SAVE_ActiveWorkbook() ActiveWorkbook.Save End Sub 回答1: Copying a worksheet to no location automatically creates a new workbook in the foreground with a copy of the worksheet as the only worksheet in the new workbook. Sub test() worksheets("sheet3").copy 'there is now a new active workbook with activeworkbook 'save it .SaveAs Filename:="some file path and filename without extension",

Winforms Save as

淺唱寂寞╮ 提交于 2020-06-13 19:08:02
问题 Does anyone know any articles or sites showing how to create a "Save as" dialogue box in win forms. I have a button, user clicks and serializes some data, the user than specifies where they want it saved using this Save as box. 回答1: You mean like SaveFileDialog? From the MSDN sample, slightly amended: using (SaveFileDialog dialog = new SaveFileDialog()) { dialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" ; dialog.FilterIndex = 2 ; dialog.RestoreDirectory = true ; if (dialog

Winforms Save as

青春壹個敷衍的年華 提交于 2020-06-13 19:07:50
问题 Does anyone know any articles or sites showing how to create a "Save as" dialogue box in win forms. I have a button, user clicks and serializes some data, the user than specifies where they want it saved using this Save as box. 回答1: You mean like SaveFileDialog? From the MSDN sample, slightly amended: using (SaveFileDialog dialog = new SaveFileDialog()) { dialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" ; dialog.FilterIndex = 2 ; dialog.RestoreDirectory = true ; if (dialog

Opening and Saving new Workbooks - VBA

China☆狼群 提交于 2020-03-06 05:28:39
问题 So I know there have been questions on this before, but none seem to explicitly solve the problems I'm having. Effectively what I'm trying to do is create a new workbook, copy and paste data into it, and then save that new workbook under a new filename. No matter what I do, I seem to get various types of error messages. Here is my code. Any help is very appreciated! Private Sub DoStuff() CurrentFile = "June_Files_macros_new.xlsm" NewFile = "Train10_June01.xls" Workbooks.Add 'Save New Workbook

downloadFile with “save as”

不羁岁月 提交于 2020-01-04 02:54:39
问题 I need to write a process to download an html file locally in my vb.net web app. I am currently using webClient.DownloadFile : Dim myWebClient As New System.Net.WebClient myWebClient.DownloadFile("http://archive.ncsa.illinois.edu/primer.html", _ "C:\test.html") Is there a built-in way to do this with a "save as" window instead, so that the user can select the location they would like the file to be saved to? Or would I need to write my own? 回答1: You can use Response.AddHeader("Content