Message 1 of 2
AcadPreferences
Not applicable
05-11-2009
06:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
VBA Newb here... I am trying to figure out why this code is not working as the tutorial I am using suggest so. I created a module, inserted the code and debugged and get a compile error and the '.RenameProfile..... is highlighted (see below). Any suggestion, help, or clarification? The code is suppose to rename current profile, import another profile, and delete the renamed profile. In essence, the code should reload the profile I have on the server in case my users loose connection to the server and their profiles get scrabbled.
Sub RestoreProfile()
Dim strActiveProfile As String
Dim strMyProfile As String
strMyProfile = "C:\Acadr2009\Profile 2009 LOCAL.ARG"
strActiveProfile = ThisDrawing.Application.Preferences.Profiles.ActiveProfile
With ThisDrawing.Application.Preferences.Profiles
.RenameProfile "Backup Profile 2009 LOCAL" ********This is the code that is highlighted after debugging*********
.ImportProfile strMyProfile, "C:\Acadr2009\Profile 2009 LOCAL.ARG ", True
.ActiveProfile = strMyProfile
.DeleteProfile "Backup Profile 2009 LOCAL"
End With
End Sub
Thanks my fellow ubergeeks!
SF Edited by: SFraz1er on May 11, 2009 1:25 PM
Sub RestoreProfile()
Dim strActiveProfile As String
Dim strMyProfile As String
strMyProfile = "C:\Acadr2009\Profile 2009 LOCAL.ARG"
strActiveProfile = ThisDrawing.Application.Preferences.Profiles.ActiveProfile
With ThisDrawing.Application.Preferences.Profiles
.RenameProfile "Backup Profile 2009 LOCAL" ********This is the code that is highlighted after debugging*********
.ImportProfile strMyProfile, "C:\Acadr2009\Profile 2009 LOCAL.ARG ", True
.ActiveProfile = strMyProfile
.DeleteProfile "Backup Profile 2009 LOCAL"
End With
End Sub
Thanks my fellow ubergeeks!
SF Edited by: SFraz1er on May 11, 2009 1:25 PM