Prev: Excel 2007: Return rownumber when text data on 3 columns match exa
Next: Using VBA to change default color palette
From: Peter T on 22 Jan 2010 15:26 Try re-registering scrrun.dll. Windows start, Run, enter the following and hit enter regsvr32 scrrun.dll As the dll is in the system folder it should get found and registered and you'll get a Success message. If not try browsing to it and try again If it fails to register or still doesn't work it's probably a 'permissions' issue, though not sure why as you are the only user. I don't recall where to look in the registry but I imagine there's plenty 'out there'. Thinking about regsvr32 again, in Vista I expect you will need to log on as administrator and maybe turn off the UAC (not sure) Regards, Peter T "Budget Programmer" <BudgetProgrammer(a)discussions.microsoft.com> wrote in message news:543CB032-A7D2-4004-A0CF-B1AAEFD718A9(a)microsoft.com... > Hi Peter, > Before doing anything, I ran stepped through your code. It stopped at the > DIM FSO statement. Initially, I couldn't a reference for "Microsoft > Scripting Runtime". I went to another PC and found that the reference is > located in file "C:\Windows\System32\scrrun.dll" I browesed for that and > was > able to add the reference. (It's interesting that I had to browse for > it.) > > However, At the SET statement I get the same error: > "Run-time error '429': > ActiveX component can't create object" > > Thanks for your help. > I'm still at a loss. > Phil > -- > Programmer on Budget > > > "Peter T" wrote: > >> If you are the only user then it sounds like it has not been disabled. >> (Though it is one component admin's sometimes want to disable in a >> corporate >> environment). >> >> In Tools References look for "Microsoft Scripting Runtime" and tick it. >> Add >> the following and run it >> >> Sub test() >> Dim objFSO As Object >> Dim fso As Scripting.FileSystemObject >> >> Set fso = New Scripting.FileSystemObject >> >> MsgBox fso.Drives.Count, , "fso New" >> Set fso = Nothing >> >> Set fso = CreateObject("Scripting.FileSystemObject") >> MsgBox fso.Drives.Count, , "fso CreateObject" >> >> Set fso = Nothing >> >> Set objFSO = CreateObject("Scripting.FileSystemObject") >> MsgBox objFSO.Drives.Count, , "objFSO CreateObject" >> >> End Sub >> >> Report back if all/some/none of the above tests worked, or if you >> couldn't >> even set the reference. >> >> Regards, >> Peter T >> >> >> "Budget Programmer" <BudgetProgrammer(a)discussions.microsoft.com> wrote in >> message news:69212031-A693-4434-ABDC-C2FFA60B492C(a)microsoft.com... >> > Peter, >> > Are you speaking of Virus Protection Software or some other system >> > setting? >> > I'm not quite sure what you mean. I'm the only one that uses the >> > machine, >> > but maybe some update or something changed it. Where should I look? >> > Thanks. >> > Phil >> > -- >> > Programmer on Budget >> > >> > >> > "Peter T" wrote: >> > >> >> Maybe Scripting has been disabled by the administrator in that machine >> >> >> >> Regards, >> >> Peter T >> >> >> >> "Budget Programmer" <BudgetProgrammer(a)discussions.microsoft.com> wrote >> >> in >> >> message news:64948855-B022-42C2-942A-15FD8E3103BD(a)microsoft.com... >> >> > Hello, >> >> > >> >> > For a year and a half I've had an Excel macro working fine. I >> >> > haven't >> >> > changed anything to the PC that would affect Excel, to my knowledge. >> >> > I'm running Vista 32 Home Premium and Office 2007. >> >> > I have the following references checked in "Tools / References": >> >> > - Visual Basic for Applications >> >> > - Microsoft Excel 12.0 Object Library >> >> > - OLE Automation >> >> > - Microsoft Office 12.0 Object Library >> >> > >> >> > This code runs on other PC's, but it stopped running on this >> >> > (essential) >> >> > one. >> >> > When it encounters the first SET statement, it give the error: >> >> > "Run-time error '429': >> >> > ActiveX component can't create object" >> >> > >> >> > Sub CreateEditedSongListing() >> >> > 'DECLARE VARIABLES >> >> > Dim objFSO As Object >> >> > Dim objFolder As Object >> >> > Dim strSongs_EditedPath As String >> >> > >> >> > 'ASSIGN INITIAL VALUES >> >> > >> >> > strSongs_EditedPath = "C:\Users\Phil\Documents\Songbook On >> >> > Screen\Songs-Edited" >> >> > >> >> > 'Use Microsoft Scripting runtime. >> >> > Set objFSO = CreateObject("Scripting.FileSystemObject") >> >> > Set objFolder = objFSO.GetFolder(strSongs_EditedPath) >> >> > End Sub >> >> > >> >> > In which reference is the "Scripting.FileSystemObject" located? >> >> > The code snipet runs fine on another PC, which has the same four >> >> > references >> >> > checked. However it stopped runing on the essential PC. >> >> > Thanks for looking into this. >> >> > Phil >> >> > -- >> >> > Programmer on Budget >> >> >> >> >> >> . >> >> >> >> >> . >>
From: Budget Programmer on 22 Jan 2010 16:44 Peter, Re-registering scrrun.dll fixed the problem. Many thanks. When I ran it straight from the "start" button, I got an error. I had to go Start / Programs / Accessories then I right-clicked on Command Prompt and selected "Run As Administrator" It registered successfully and the Macro ran as before. I have no idea how scrrun.dll got unregistered, but that fixed it. (BTW, this site's e-mail notifications aren't working today. Also, the "index" for the Search For field doesn't seem to be updated). Again, Many Many thanks. Phil -- Programmer on Budget "Peter T" wrote: > Try re-registering scrrun.dll. > Windows start, Run, enter the following and hit enter > regsvr32 scrrun.dll > > As the dll is in the system folder it should get found and registered and > you'll get a Success message. If not try browsing to it and try again > > If it fails to register or still doesn't work it's probably a 'permissions' > issue, though not sure why as you are the only user. I don't recall where to > look in the registry but I imagine there's plenty 'out there'. > > Thinking about regsvr32 again, in Vista I expect you will need to log on as > administrator and maybe turn off the UAC (not sure) > > Regards, > Peter T > > > > "Budget Programmer" <BudgetProgrammer(a)discussions.microsoft.com> wrote in > message news:543CB032-A7D2-4004-A0CF-B1AAEFD718A9(a)microsoft.com... > > Hi Peter, > > Before doing anything, I ran stepped through your code. It stopped at the > > DIM FSO statement. Initially, I couldn't a reference for "Microsoft > > Scripting Runtime". I went to another PC and found that the reference is > > located in file "C:\Windows\System32\scrrun.dll" I browesed for that and > > was > > able to add the reference. (It's interesting that I had to browse for > > it.) > > > > However, At the SET statement I get the same error: > > "Run-time error '429': > > ActiveX component can't create object" > > > > Thanks for your help. > > I'm still at a loss. > > Phil > > -- > > Programmer on Budget > > > > > > "Peter T" wrote: > > > >> If you are the only user then it sounds like it has not been disabled. > >> (Though it is one component admin's sometimes want to disable in a > >> corporate > >> environment). > >> > >> In Tools References look for "Microsoft Scripting Runtime" and tick it. > >> Add > >> the following and run it > >> > >> Sub test() > >> Dim objFSO As Object > >> Dim fso As Scripting.FileSystemObject > >> > >> Set fso = New Scripting.FileSystemObject > >> > >> MsgBox fso.Drives.Count, , "fso New" > >> Set fso = Nothing > >> > >> Set fso = CreateObject("Scripting.FileSystemObject") > >> MsgBox fso.Drives.Count, , "fso CreateObject" > >> > >> Set fso = Nothing > >> > >> Set objFSO = CreateObject("Scripting.FileSystemObject") > >> MsgBox objFSO.Drives.Count, , "objFSO CreateObject" > >> > >> End Sub > >> > >> Report back if all/some/none of the above tests worked, or if you > >> couldn't > >> even set the reference. > >> > >> Regards, > >> Peter T > >> > >> > >> "Budget Programmer" <BudgetProgrammer(a)discussions.microsoft.com> wrote in > >> message news:69212031-A693-4434-ABDC-C2FFA60B492C(a)microsoft.com... > >> > Peter, > >> > Are you speaking of Virus Protection Software or some other system > >> > setting? > >> > I'm not quite sure what you mean. I'm the only one that uses the > >> > machine, > >> > but maybe some update or something changed it. Where should I look? > >> > Thanks. > >> > Phil > >> > -- > >> > Programmer on Budget > >> > > >> > > >> > "Peter T" wrote: > >> > > >> >> Maybe Scripting has been disabled by the administrator in that machine > >> >> > >> >> Regards, > >> >> Peter T > >> >> > >> >> "Budget Programmer" <BudgetProgrammer(a)discussions.microsoft.com> wrote > >> >> in > >> >> message news:64948855-B022-42C2-942A-15FD8E3103BD(a)microsoft.com... > >> >> > Hello, > >> >> > > >> >> > For a year and a half I've had an Excel macro working fine. I > >> >> > haven't > >> >> > changed anything to the PC that would affect Excel, to my knowledge. > >> >> > I'm running Vista 32 Home Premium and Office 2007. > >> >> > I have the following references checked in "Tools / References": > >> >> > - Visual Basic for Applications > >> >> > - Microsoft Excel 12.0 Object Library > >> >> > - OLE Automation > >> >> > - Microsoft Office 12.0 Object Library > >> >> > > >> >> > This code runs on other PC's, but it stopped running on this > >> >> > (essential) > >> >> > one. > >> >> > When it encounters the first SET statement, it give the error: > >> >> > "Run-time error '429': > >> >> > ActiveX component can't create object" > >> >> > > >> >> > Sub CreateEditedSongListing() > >> >> > 'DECLARE VARIABLES > >> >> > Dim objFSO As Object > >> >> > Dim objFolder As Object > >> >> > Dim strSongs_EditedPath As String > >> >> > > >> >> > 'ASSIGN INITIAL VALUES > >> >> > > >> >> > strSongs_EditedPath = "C:\Users\Phil\Documents\Songbook On > >> >> > Screen\Songs-Edited" > >> >> > > >> >> > 'Use Microsoft Scripting runtime. > >> >> > Set objFSO = CreateObject("Scripting.FileSystemObject") > >> >> > Set objFolder = objFSO.GetFolder(strSongs_EditedPath) > >> >> > End Sub > >> >> > > >> >> > In which reference is the "Scripting.FileSystemObject" located? > >> >> > The code snipet runs fine on another PC, which has the same four > >> >> > references > >> >> > checked. However it stopped runing on the essential PC. > >> >> > Thanks for looking into this. > >> >> > Phil > >> >> > -- > >> >> > Programmer on Budget > >> >> > >> >> > >> >> . > >> >> > >> > >> > >> . > >> > > > . >
From: Peter T on 23 Jan 2010 06:08
Glad it worked and thanks for the feedback. > (BTW, this site's e-mail notifications aren't working today. Also, the > "index" for the Search For field doesn't seem to be updated). Neither of these have worked in "WebNews" for ages, there are other ways though to access these groups. Regards, Peter T "Budget Programmer" <BudgetProgrammer(a)discussions.microsoft.com> wrote in message news:72DB8ABC-66D1-4BBF-9427-212F4F32306B(a)microsoft.com... > Peter, > Re-registering scrrun.dll fixed the problem. Many thanks. > > When I ran it straight from the "start" button, I got an error. I had to > go > Start / Programs / Accessories then I right-clicked on Command Prompt and > selected "Run As Administrator" It registered successfully and the Macro > ran > as before. I have no idea how scrrun.dll got unregistered, but that fixed > it. > > (BTW, this site's e-mail notifications aren't working today. Also, the > "index" for the Search For field doesn't seem to be updated). > > Again, Many Many thanks. > Phil > -- > Programmer on Budget > > > "Peter T" wrote: > >> Try re-registering scrrun.dll. >> Windows start, Run, enter the following and hit enter >> regsvr32 scrrun.dll >> >> As the dll is in the system folder it should get found and registered and >> you'll get a Success message. If not try browsing to it and try again >> >> If it fails to register or still doesn't work it's probably a >> 'permissions' >> issue, though not sure why as you are the only user. I don't recall where >> to >> look in the registry but I imagine there's plenty 'out there'. >> >> Thinking about regsvr32 again, in Vista I expect you will need to log on >> as >> administrator and maybe turn off the UAC (not sure) >> >> Regards, >> Peter T >> >> >> >> "Budget Programmer" <BudgetProgrammer(a)discussions.microsoft.com> wrote in >> message news:543CB032-A7D2-4004-A0CF-B1AAEFD718A9(a)microsoft.com... >> > Hi Peter, >> > Before doing anything, I ran stepped through your code. It stopped at >> > the >> > DIM FSO statement. Initially, I couldn't a reference for "Microsoft >> > Scripting Runtime". I went to another PC and found that the reference >> > is >> > located in file "C:\Windows\System32\scrrun.dll" I browesed for that >> > and >> > was >> > able to add the reference. (It's interesting that I had to browse for >> > it.) >> > >> > However, At the SET statement I get the same error: >> > "Run-time error '429': >> > ActiveX component can't create object" >> > >> > Thanks for your help. >> > I'm still at a loss. >> > Phil >> > -- >> > Programmer on Budget >> > >> > >> > "Peter T" wrote: >> > >> >> If you are the only user then it sounds like it has not been disabled. >> >> (Though it is one component admin's sometimes want to disable in a >> >> corporate >> >> environment). >> >> >> >> In Tools References look for "Microsoft Scripting Runtime" and tick >> >> it. >> >> Add >> >> the following and run it >> >> >> >> Sub test() >> >> Dim objFSO As Object >> >> Dim fso As Scripting.FileSystemObject >> >> >> >> Set fso = New Scripting.FileSystemObject >> >> >> >> MsgBox fso.Drives.Count, , "fso New" >> >> Set fso = Nothing >> >> >> >> Set fso = CreateObject("Scripting.FileSystemObject") >> >> MsgBox fso.Drives.Count, , "fso CreateObject" >> >> >> >> Set fso = Nothing >> >> >> >> Set objFSO = CreateObject("Scripting.FileSystemObject") >> >> MsgBox objFSO.Drives.Count, , "objFSO CreateObject" >> >> >> >> End Sub >> >> >> >> Report back if all/some/none of the above tests worked, or if you >> >> couldn't >> >> even set the reference. >> >> >> >> Regards, >> >> Peter T >> >> >> >> >> >> "Budget Programmer" <BudgetProgrammer(a)discussions.microsoft.com> wrote >> >> in >> >> message news:69212031-A693-4434-ABDC-C2FFA60B492C(a)microsoft.com... >> >> > Peter, >> >> > Are you speaking of Virus Protection Software or some other system >> >> > setting? >> >> > I'm not quite sure what you mean. I'm the only one that uses the >> >> > machine, >> >> > but maybe some update or something changed it. Where should I look? >> >> > Thanks. >> >> > Phil >> >> > -- >> >> > Programmer on Budget >> >> > >> >> > >> >> > "Peter T" wrote: >> >> > >> >> >> Maybe Scripting has been disabled by the administrator in that >> >> >> machine >> >> >> >> >> >> Regards, >> >> >> Peter T >> >> >> >> >> >> "Budget Programmer" <BudgetProgrammer(a)discussions.microsoft.com> >> >> >> wrote >> >> >> in >> >> >> message news:64948855-B022-42C2-942A-15FD8E3103BD(a)microsoft.com... >> >> >> > Hello, >> >> >> > >> >> >> > For a year and a half I've had an Excel macro working fine. I >> >> >> > haven't >> >> >> > changed anything to the PC that would affect Excel, to my >> >> >> > knowledge. >> >> >> > I'm running Vista 32 Home Premium and Office 2007. >> >> >> > I have the following references checked in "Tools / References": >> >> >> > - Visual Basic for Applications >> >> >> > - Microsoft Excel 12.0 Object Library >> >> >> > - OLE Automation >> >> >> > - Microsoft Office 12.0 Object Library >> >> >> > >> >> >> > This code runs on other PC's, but it stopped running on this >> >> >> > (essential) >> >> >> > one. >> >> >> > When it encounters the first SET statement, it give the error: >> >> >> > "Run-time error '429': >> >> >> > ActiveX component can't create object" >> >> >> > >> >> >> > Sub CreateEditedSongListing() >> >> >> > 'DECLARE VARIABLES >> >> >> > Dim objFSO As Object >> >> >> > Dim objFolder As Object >> >> >> > Dim strSongs_EditedPath As String >> >> >> > >> >> >> > 'ASSIGN INITIAL VALUES >> >> >> > >> >> >> > strSongs_EditedPath = "C:\Users\Phil\Documents\Songbook On >> >> >> > Screen\Songs-Edited" >> >> >> > >> >> >> > 'Use Microsoft Scripting runtime. >> >> >> > Set objFSO = CreateObject("Scripting.FileSystemObject") >> >> >> > Set objFolder = objFSO.GetFolder(strSongs_EditedPath) >> >> >> > End Sub >> >> >> > >> >> >> > In which reference is the "Scripting.FileSystemObject" located? >> >> >> > The code snipet runs fine on another PC, which has the same four >> >> >> > references >> >> >> > checked. However it stopped runing on the essential PC. >> >> >> > Thanks for looking into this. >> >> >> > Phil >> >> >> > -- >> >> >> > Programmer on Budget >> >> >> >> >> >> >> >> >> . >> >> >> >> >> >> >> >> >> . >> >> >> >> >> . >> |