1. G

    SaveAs save in right folder

    Hi I got this code: Private Sub GemSom_Click() If Dir(ThisWorkbook.Path & "" & Range("b6").Value & " " & Date, vbDirectory) = "" Then MkDir ThisWorkbook.Path & "" & Range("b6").Value & " " & Date End If 'Dim Path As String 'Dim FileName As String 'FileName = Range("b6").Value & " " & Date...
  2. M

    Open This Workbook.Path

    I'm having problems understanding how to designate a specific file path on this line of code. This works as long as the file is one folder before \old reports..... As soon as the file is moved the code no longer works. I would like to be able to hardcode a folder such as...
  3. D

    VBA to import data in already opened third party software.

    Sub openspcolumn() CreateObject("Shell.Application").Open (ThisWorkbook.Path & "\SP" & "\slendercolumn.col") End Sub ............................................................................................................................................................. This code...
  4. R

    Running code on all files from a folder

    Hello Guys, I would like to run this code on all files from a specific folder. Someone could please help me? Best Regards, Rafael Fernandes Code (from Tommy Miles of Houston, Texas): Sub SplitWorkbook() Dim ws As Worksheet Dim DisplayStatusBar As Boolean DisplayStatusBar =...
  5. J

    How do i use Thisworkbook.path with this VBA

    Hi, i have some code which works fine with a set URL but i want to substitute it to use the workbook path ThisWorkbook.Path & "\MYDB\DATABASE1.mdb" the code below Sub getData1() dat1 = Range("I2").Value MYSQL = "SELECT * FROM `C:\test\MYDB\DATABASE1.mdb`.TABLE1 TABLE1WHERE TABLE1.EDAT="...
  6. syndee

    Anyway to stop Excel from flickering when opening a macro

    Have workbook that does everything I want but flickers when I open it. I have Screen updating. false but still flickers. Maybe it's normal, just thought I'd ask. Private Sub Workbook_Open() Application.ScreenUpdating = False Workbooks.Open (ThisWorkbook.Path & "\Accrual Report.csv")...
  7. ask2tsp

    ThisWorkbook.Path value running Office/365 and onedrive

    T o create files in the folder where the workbook is located Thisworkbook.Path is the preferred choice, but that gives errors with Office/365 and onedrive. In my case Thisworkbook.Path= " snippets/Symbol table" local (in my laptop) this...
  8. A

    Refresh Chart in userform

    Hey community, I use userform where users can select workers name and gets details about him. I want to put chart in userform to show workers progress. But it shows only last result. it is not updating when i choose different worker. Any solution for instant update of chart result ?' Private...
  9. B

    Auto Filter of range class failed

    Hello I keep getting an error that I can't figure out why, I have been racking my brain for hours. I keep getting the auto filter of range class failed and all spelling is correct and there shouldn't be any problems. Here is my code. Sub SplitCodeFilterSheet() Dim wswb As StringDim wssh As...
  10. A

    VBA - Customizing Excel file name using named range and attaching to email

    I have figured out how to customize an excel file name and attach it to an email, but cannot seem to get the code to work using a named range in my workbook. I want to use a named range so the file name is automatically adjusted based on information within the workbook. This is the code that...
  11. sharky12345

    Open .txt file

    Can someone show me how I can open the following file through VBA? dt = Format(Now, "dd_mm_yyyy_hh:mm") ThisWorkbook.path & "\Vehicle Maintenance Files\Reports\Vehicle Fleet Status Log " & dt & ".txt"
  12. kelly mort

    File path issue gets tougher

    Hello I have this issue here and I need help : Sub pdfCreate () Dim FolderPath As String FolderPath = ThisWorkbook.Path & "\PDF FILES" ChDir ThisWorkbook.Path & "\PDF FILES" Sheet10.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Sheet10.Range("F4").Text, Quality:=xlQualityStandard, _...
  13. M

    Using excel to create a folder in a sharepoint library

    Hi all - i am working in Excel 2010 and our comnpany are starting to use SharePoint. Within a number of the excel files we use, there is a need to produce a pdf report of one or more of the worksheets. This worked fine when saving using network folders (simple thisworkbook.path method)...
  14. U

    Trying to link data from two programs, getting "Run-time 1004: Method 'Range' of object '_Worksheet' failed"

    Hello, I have a two excel workbooks, one (Workbook A) which is designed with a macro to pull in info from the other (Workbook B). Recently someone made changes to Workbook A that prevent the linking from occurring, but I do not know what they did. The VBA is identical to the an older version of...

Some videos you may like

This Week's Hot Topics