Sub GenerateTitle()Dim pos As String Dim pos2 As String Dim xlSheet As Excel.Worksheet Set xlSheet =Workbook("database.xls") .Worksheets("Result")If isGrade = True Then pos = alpha(index) + CStr(2)Sheets("Result").Activate Range(pos).Value = "Grade"index = index + 1 ...
\nSub Extraction()\n Dim WS_Count As Long\n Dim I As Long\n Dim LR As Long\n Dim WS As Worksheet\n Application.ScreenUpdating = False\n Set WS = Worksheets(\"Results\")\n LR = WS.Cells(WS.Rows.Count, 1).End(xlUp).Row\n WS_Count = ActiveWorkbook.Worksheets.Count\...
Set ex = CreateObject("Excel.Application")With ex .Workbooks.Open Trim(文件路径).Sheets("Sheet1").select .Sheets("Sheet1").Range("A11").value = "00".ActiveWorkbook.Save .Quit End With 我是这样用的。看你的代码只有打开文件操作完后没有关闭文件 ...
Re: Run-time error '1004' Method 'Charts' of object '_Global' failed The trouble is that you are using the "Active..." objects, it should be fine if you specify the workbook/sheets etc, try this: VB Code: Dim myChart as Object With ThisWorkbook.WorkSheets("Sheet1") Se...
{"__ref":"Forum:board:ExcelGeneral"},"conversation":{"__ref":"Conversation:conversation:2108156"},"subject":"Re: VBA: runtime error 1004 : Method range of object - 'Global' failed","readOnly":false,"editFrozen":false,"moderationData":{"__ref":"ModerationData:moderation_...
Method 'SaveAs' of object '_Worksheet' failed Cause This behavior can occur when both the following conditions are true: You are using a Visual Basic for Applications macro to save a worksheet. -and- You specify the fi...
IWorksheets IWorksheetView IXmlDataBinding IXmlMap IXmlMaps IXmlNamespace IXmlNamespaces IXmlSchema IXmlSchemas IXPath Label Labels LeaderLines Legend LegendEntries LegendEntry LegendKey Line LinearGradient LineFormat Lines LinkFormat ListBox ListBoxes ListColumn ListColumns ListDataFormat ListObject List...
IWorksheets IWorksheetView IXmlDataBinding IXmlMap IXmlMaps IXmlNamespace IXmlNamespaces IXmlSchema IXmlSchemas IXPath Label Labels LeaderLines Legend LegendEntries LegendEntry LegendKey Line LinearGradient LineFormat Lines LinkFormat ListBox ListBoxes ListColumn ListColumns ListDataFormat ListObject List...
Filename Object A String that indicates the name of the file to be saved. You can include a full path or short. Excel2007 saves the file in the current folder. Quality Object Can be set to either xlQualityStandard or xlQualityMinimum. IncludeDocProperties Object Set to True to indicat...
After Object Optional Object. An object that specifies the sheet after which the new sheet is added. Count Object Optional Object. The number of sheets to be added. The default value is one. Type Object Optional Object. Specifies the sheet type. Can be one of the following XlSheetType...