Search results

  1. M

    Can you save a file with yesterday's date in the file name?

    Only requires a little change. If Format(Date, "dddd") = "Monday" Then objWord.Application.ActiveDocument.SaveAs "K:\Letters\270_30_DelqLetters\PrintCenter" _ & Format(Date - 3, "mmddyy") & ".doc" Else objWord.Application.ActiveDocument.SaveAs...
  2. M

    Access to Excel

    After references I guess I'll post the code the way I think it should be: Private Sub LoadInfo_Click() Dim objXLApp As Object Dim objXLBook As Excel.Workbook dim oSheet as Excel.Worksheet Set objXLApp = CreateObject("Excel.Application") Set objXLBook = objXLApp.Workbooks.Open("C:\Q11.xls")...
  3. M

    Access to Excel

    Reference Also, it sounds like you might not have a reference set for Excel. Have you ran any of this code successfully yet? Check your references. Open a code module, Tools, references and make sure you have a reference to Microsoft Excel. If not, check the checkbox and try again.
  4. M

    Access to Excel

    Dim oSheet As Excel.Worksheet Set oSheet = objXLBook.Worksheets(1) oSheet.Range("B9") = me.NAME If that is a cell you want to fill then: omit oSheet.Range("B9") = me.NAME and use: oSheet.Cells(2, 9).Value = Me.Name
  5. M

    Can you save a file with yesterday's date in the file name?

    Maybe this will put you in the right direction: If Format(Date, "dddd") = "Monday" Then MsgBox ("It Is Monday") Else MsgBox ("It's not Monday.") End If
  6. M

    Can you save a file with yesterday's date in the file name?

    I had something similar that I did once with a zip file. I used: strFilename = CStr(Format(Date, "mmddyy")) & "MAIN.zip" Do you mean If today is Monday, save it as Fridays date?
  7. M

    Access to Excel

    I think I helped you once before? I can't remember. Anyway: Dim oSheet As Excel.Worksheet Set oSheet = objXLBook.Worksheets(1) 'Whichever worksheet you want to refer to is the number
  8. M

    Convert 600 to 6.00

    Divide Doesn't it work if you divide things by 100? 7983 / 100 = 79.83 DJKarl (7983 / 1000 is 7.983) You might be able to use the CDbl function like: CDbl(TheNumber / 100)
  9. M

    sp3's

    Hotfix, does it fix it? I installed Office 2003 sp3 and a lot of my combo boxes and list boxes stopped being populated. I found out that if you force uppercase in a table field property (Set the format property to >), it "breaks" combo boxes and list boxes (stops them from loading). Did the...
  10. M

    MySQL Vs. MS SQL Server

    Thanks! Thank you for you reply. I am running a ton of timekeeping records and draw a lot of different information from them. Some of the calculations take a lot of time and modules to run. (Leave balances based on dated:Starting balance + leave earnings + leave taken (in a date period)) etc...
  11. M

    SQL to VBA

    I don't know who originally wrote this but I use it all the time for formatting SQL to a VBA SQL statement. I modified the conversion of vbCrLf to VbNewLine. (The old form is still there) I read somewhere that VbNewLine was just a little faster than the vbCrLf. Who knows? It could use a little...
  12. M

    MySQL Vs. MS SQL Server

    I've been running Access backends for 10 years now but the BE's are growing out of control. To expand and grow, we want to upgrade our Access BE's to something better. Currently our server platform is Novell which comes with MySQl. Our network administrator wants me to use it as our Access BE...
  13. M

    Delete all rows in Excel document except Row 1

    Worked? Just wondering if the last post of the corrected code worked for you?
  14. M

    Delete all rows in Excel document except Row 1

    Messed up! I really blundered that code! I just started doing this forum help stuff. ok, I tested this code and it worked perfectly for what you said you wanted to do. Function ClearTemplates() Dim oXL As Object Dim oBook As Excel.Workbook Dim oSheet As Excel.Worksheet Set oXL =...
  15. M

    Delete all rows in Excel document except Row 1

    Maybe this will help. Dim aRange As Excel.Range = WorkSheet.Range("C4:G4") aRange.ClearContents() You would set the range of cells you want to clear and issue a ClearContents() on the range set.
  16. M

    Opening Excel from Access

    reputation? Don't forget to tip my scale :) Just trying to build a good reputation! Thanks!
  17. M

    Opening Excel from Access

    Set xlWrkb = xlApp.Workbooks.Open("C:\Users\" & Environ("UserName") & "\Desktop\Selection_List.xls") Take off the set xlWrkb = part and try your code. Example: xlApp.Workbooks.Open("C:\Users\" & Environ("UserName") & "\Desktop\Selection_List.xls")
  18. M

    Opening Excel from Access

    Private Sub Something() Dim oXL As Object Dim oExcel As Object Dim sFullPath As String Dim sPath As String ' Create a new Excel instance Set oXL = CreateObject("Excel.Application") ' Only XL 97 supports UserControl Property On Error...
  19. M

    Opening Excel from Access

    If the query is still running when it hits the open workbook, this should delay for 20 seconds to see if I am right. Paste this line in ABOVE your code reading Dim xlApp As Object, xlWrkb As Object Dim dblEndTime As Double Dim TT As Double TT = Timer dblEndTime = Timer + 20# 'Here is where...
  20. M

    Opening Excel from Access

    Already open Looks to me like in your first line of code, the workbook is already open. The script out of range happens when it tries to open (while it is already open) again in your openworkbook code. ----------------------------- To explain a little more: I think the workbook is still open...
Back
Top Bottom