cmd

  1. A

    Call .cmd from VBA to copy files from local to external drive

    Hi all, I am attempting to optimize the speed of my VBA code when copying files to external drive. An observation was made that the wkBk.SaveAs command to save file in external drive takes quite a while to complete, whereas if the command to copy is used in CMD command, it takes a split second...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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...
  7. 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...
  8. D

    Run MS Dos Command CMD any copy text from Excel cells...help 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...
  9. 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...
  10. 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
  11. 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")...
  12. 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...
  13. 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...
  14. 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""...
  15. 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
  16. 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 =...
  17. 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 =...
  18. 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...
  19. 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...
  20. 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...

Watch MrExcel Video

This Week's Hot Topics

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top