vba

Excel VBA - convert range with pictures and buttons to HTML

本秂侑毒 提交于 2021-02-07 10:57:20
问题 I wrote a function that turns an excel range into HTML for further use in an email body. The problem is that I now want to add pictures and buttons to the range and have it then taken over into the email body. How I can get excel to address objects in the range and convert them over as well? Thanks Function Range to HTML Function RangetoHTML(rng As Range) ' Changed by Ron de Bruin 28-Oct-2006 ' Working in Office 2000-2013 Dim fso As Object Dim ts As Object Dim TempFile As String Dim TempWB As

excel vba + how to programmatically add code to button

℡╲_俬逩灬. 提交于 2021-02-07 10:47:19
问题 I have a button in a workdbook (wbShared), clicking on that button a second workbook (wbNewUnshared) opens. I want to add a button to wbNewUnshared with code programmatically. I already found how to add the button, but I didn't find how to add code to this button. 'create button '-------------------------------------------------------- Dim objBtn As Object Dim ws As Worksheet Dim celLeft As Integer Dim celTop As Integer Dim celWidth As Integer Dim celHeight As Integer Set ws = wbNewUnshared

Parse XML from VBA not working

谁说胖子不能爱 提交于 2021-02-07 10:30:39
问题 I am trying to parse xml file using excel vba. This is how my xml file looks like: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <Environment> <Variable> <Name></Name> <Caption>T1</Caption> <Type>TEXT</Type> <Value>V1</Value> <Description></Description> </Variable> <Variable> <Name></Name> <Caption>T2</Caption> <Type>TEXT</Type> <Value>V2</Value> <Description></Description> </Variable> <Variable> <Name></Name> <Caption>T3</Caption> <Type>TEXT</Type> <Value>V3</Value> <Description><

Parse XML from VBA not working

感情迁移 提交于 2021-02-07 10:29:26
问题 I am trying to parse xml file using excel vba. This is how my xml file looks like: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <Environment> <Variable> <Name></Name> <Caption>T1</Caption> <Type>TEXT</Type> <Value>V1</Value> <Description></Description> </Variable> <Variable> <Name></Name> <Caption>T2</Caption> <Type>TEXT</Type> <Value>V2</Value> <Description></Description> </Variable> <Variable> <Name></Name> <Caption>T3</Caption> <Type>TEXT</Type> <Value>V3</Value> <Description><

How to open Word Application using vba

穿精又带淫゛_ 提交于 2021-02-07 10:29:15
问题 I have a code. It does not run in 2016.Is it a Office 16 problem Dim objWordApp as Word.Application Dim objWordDoc as Word.document Set objWordApp = new Word.application I get an error Error in loading DLL .I have already included the library Microsoft word 16.0 Object Library regards Anna 回答1: I am not sure what went wrong for you but if you just want to open a new word document with your default MS office then you can use this peace of code Sub wordopener() Dim objWord Dim objDoc Set

Parse XML from VBA not working

别等时光非礼了梦想. 提交于 2021-02-07 10:29:02
问题 I am trying to parse xml file using excel vba. This is how my xml file looks like: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <Environment> <Variable> <Name></Name> <Caption>T1</Caption> <Type>TEXT</Type> <Value>V1</Value> <Description></Description> </Variable> <Variable> <Name></Name> <Caption>T2</Caption> <Type>TEXT</Type> <Value>V2</Value> <Description></Description> </Variable> <Variable> <Name></Name> <Caption>T3</Caption> <Type>TEXT</Type> <Value>V3</Value> <Description><

How to open Word Application using vba

*爱你&永不变心* 提交于 2021-02-07 10:28:06
问题 I have a code. It does not run in 2016.Is it a Office 16 problem Dim objWordApp as Word.Application Dim objWordDoc as Word.document Set objWordApp = new Word.application I get an error Error in loading DLL .I have already included the library Microsoft word 16.0 Object Library regards Anna 回答1: I am not sure what went wrong for you but if you just want to open a new word document with your default MS office then you can use this peace of code Sub wordopener() Dim objWord Dim objDoc Set

How to open Word Application using vba

牧云@^-^@ 提交于 2021-02-07 10:27:04
问题 I have a code. It does not run in 2016.Is it a Office 16 problem Dim objWordApp as Word.Application Dim objWordDoc as Word.document Set objWordApp = new Word.application I get an error Error in loading DLL .I have already included the library Microsoft word 16.0 Object Library regards Anna 回答1: I am not sure what went wrong for you but if you just want to open a new word document with your default MS office then you can use this peace of code Sub wordopener() Dim objWord Dim objDoc Set

VBA Copy data from an unopened CSV file to worksheet without opening closed CSV

时间秒杀一切 提交于 2021-02-07 10:13:17
问题 I believe I have a unique problem as I have not seen anything like it anywhere on the Internet. I am a business analyst/application developer and I want to automatically gather the data from other user's Excel CSV file on their personal computer without opening the file and disrupting them. Is there a way? Here is the code I have so far: Option Explicit Dim MyDocuments As String, strFileName, myToday, origWorkbook, origWorksheet, strConnection Dim row As Integer Private Sub btnStart_Click()

VBA/Outlook extracting attachments from .eml files

不羁的心 提交于 2021-02-07 10:12:16
问题 I'm trying to take a folder full of .eml messages with attachments and then extract/rename/save the attachments in another folder. My code : Sub SaveAttachments() Dim OlApp As Outlook.Application Set OlApp = GetObject(, "Outlook.Application") Dim MsgFilePath Dim Eml As Outlook.MailItem Dim att As Outlook.Attachments Dim Path As String Path = "C:\Users\richard\Desktop\Inbox\" If OlApp Is Nothing Then Err.Raise ERR_OUTLOOK_NOT_OPEN End If Dim fs As Object Set fs = CreateObject("Scripting