1. M

    Excel - running a cmd line from a cell to cmd/powershell

    Hi, I have a cell with a command on it and would it be possible to be launched to cmd or powershell? I encountered this function, PID = Shell("notepad c:\MyFiles\TextFile.txt", vbNormalFocus) but I am not sure how would this launch to cmd or powershell. How would I incorporate the cell with...
  2. M

    ROBOCOPY - Incorporate to excel VBA

    Hi, I am thinking of incorporating the ROBOCOPY with excel since I am doing a lot of file transfers. I just have no idea where to start. I would like to be able to enter a source and destination path into a cell then maybe some radio button or any kind of selection depending on what specific...
  3. Q

    If statement to remove cell content

    I have a spreadsheet which, as the user selects a couple of options, builds some CMD lines and outputs a batch file. One cell is using concat to build the CMD line =CONCAT($F$6,C6,$G$6,$H$6,$I$6) but I need to wrap this up so, if there is no data in C6 the concat formula does not apply and the...
  4. I

    Macro which adds 1 to a range of cells on different sheets

    Morning guys, I have a workbook with 3 worksheets(tabs) and on the 1st sheet I am using a cmd button to change the sheet once clicked to change a cell with the time in it from 0600 to 1530, is it possible that every time I click the cmd button and it changes the time to 0600 it adds 1 to a...
  5. D

    Paste column from Excel to Command Prompt

    I have a spreadsheet that takes a list of file names, modifies new file names, and creates the "ren" command to execute using command prompt. So I may have 50 rows from F2:F51 that look like this: I want to create a macro that pastes this into CMD to run. Normally, you can open CMD and just...
  6. T

    cmd /c del to delete file

    I want to use the cmd /c del command to delete a file, instead of Kill. This works: Dim Loc As String Loc = "C:\MyFolder\abcdef.xlsm" Dim cmd As String cmd = "cmd /c del " & Loc Shell cmd but if the filename contains a space like this, it fails...
  7. D

    Run MS Dos Command CMD any copy text from Excel please?

    Hi, I am almost there but struggling with the last part - I have a command line in an Excel workbook (SHEET1 cells A1 to A10) - I would like to have a macro to open cmd (command in MS DOS) and then copy the text in cells A1 to A10 to the command (CMD) line. So far I have Shell "cmd.exe /k...
  8. J

    Fetch value for comma separated values from Single Cell.

    Dear Experts, Greetings from India. Is it possible that we can fetch values from comma separated values from a single cell to their corresponding values from a range? Col A Col B Col C Col D A AF A, B, D, E AF, AD, CMD, CW B AD C...
  9. F

    Open .xls from CMD with password

    Hi I need to open in CMD command line, a 2010 excel workbook with open password same like this: C:\Program Files\Microsoft Office\OFFICE11\excel.exe C:\Documents and Settings\Paul\My Documents\libro1.xlsx password="1234" I don´t Know how do this thanks a lot best regards
  10. H

    Worksheet save as .csv(Comma deli) and rename as .txt by cmd.exe

    I am trying to save a sheet as .Csv (Comma delimited) and then rename as .Txt by Cmd.exe (Shell) but not working. Please help me !!! Dim MyFolder As String, MyFile As String, MySheetName as String Dim ShellComand As String ......... MyFolder = "D:\Revise" MyFile = Dir(MyFolder & "\*.txt")...
  11. H

    Adding Controls To TabStrip On UserForm

    Hi I'm trying to add a control (ListBox) to a Tabstrip. I can add a control to a Frame but using the same technique I thought that I had it sussed. Apparently not. Set Cmd = Frame1.Controls.Add("Forms.CommandButton.1", "cmd1") Cmd.Left = 30 Cmd.Top = 70 Lbl.BackColor...
  12. N

    VBA Enhancement

    Hi, I converted an Access macro to VBA, I have a cmd button (cmdDD) on my form (frmDateDescription) to export this to a specific location. Can someone tell me please how to modify the code below in my Event Procedure of the cmd button to point to K:\CLE09\keyfound\Trust - Check Print for the...
  13. DippNCope

    help with shell cmd net user

    Hello, I have a list of user ID's in column C. I am trying to find when thier AD passwords expire. I would like to run a macro to run the command net user This is what I have so far UID = Range("C2").Value RetVal = Shell("""cmd.exe """" /domain " & UID & " | findstr ""Password expires""...
  14. N

    VBA code to run CMD code

    Hello friends, I am using Excel 2007 I want the vba code to open CMD and run the following code and close CMD. CMD code: attrib "d:\test.txt" +s +h +r Please help
  15. RobbieC

    VBA sub to launch external app/program

    Hi there, I have a macro (AddNewPhoto) which allows me to select a photo and put it into my spreadsheet. The macro is triggered from a button on a userform. I have also got a macro which will launch the camera on my tablet: Sub launchCamera() Dim MyFile As String Dim Cmd As String MyFile =...
  16. P

    Shell cmd window position?

    Is there a simple was to control the position of the cmd shell window. I am using this to position userforms and popups(msgbox) and this works well. ' Simple "with" to put Userform in centre of monitor when I'm using 2 monitors With MYUSERFORM .StartUpPosition = 0 .Left =...
  17. G

    error ...install network printer using senkeys

    I am having difficulty installing new network printer via sendkeys, the issue is that I send the first sendkeys code which is show start dialog = ctrl +esc then the next line I wish to sendkeys "cmd", but instead of sending it to the same application, it looses focus and send it to my vba script...
  18. M

    Combining files within a folder into pdf

    Hello, I am a VBA novice so bear with me, please. Every month, I run about 20 report packets, made of of a variable number of pdf's. Sometimes I need to re-run etc, some months I'll lose a packet or gain one depending on my assignment. Lets say the files for each packet are 1.pdf, 2.pdf, etc...
  19. J

    Active Directory Query Groups

    I have been working on some code to get Excel to retrieve every group that a user is a member of in AD. This will be for comparing users permission and I was looking to get the code onto an excel spreadsheet so I could sort the data. I have been successful using cmd to get the info into a txt...
  20. N

    Macro for executing commands from cmd prompt

    Macro for executing commands from cmd prompt I need to run a batch from command prompt. It has exe file as well. My moto is to activate exe as schedule run. Below are the problem which I am facing due to which I need a macro to be created. Any of the resolution can solve my problem. This...

Some videos you may like

This Week's Hot Topics